﻿using System;
using System.Data.Entity;
using PhotoLife.Data.Contracts;

namespace PhotoLife.Data
{
    public class UnitOfWork : IUnitOfWork
    {
        private readonly DbContext dbContext;

        public UnitOfWork(DbContext context)
        {
            if (context == null)
            {
                throw new ArgumentNullException("Context cannot be null");
            }

            this.dbContext = context;
        }

        public void Dispose()
        {
        }

        public void Commit()
        {
            this.dbContext.SaveChanges();
        }
    }
}

﻿using System;
using PhotoLife.Data.Contracts;

namespace PhotoLife.Data
{
    public class UnitOfWork : IUnitOfWork
    {
        private readonly IPhotoLifeEntities dbContext;

        public UnitOfWork(IPhotoLifeEntities context)
        {
            if (context == null)
            {
                throw new ArgumentNullException("Context cannot be null");
            }

            this.dbContext = context;
        }

        public void Dispose()
        {
        }

        public void Commit()
        {
            this.dbContext.SaveChanges();
        }
    }
}

Fix unit of work ctor param
Fix unit of work ctor param
