//public IRepository<T> Repository<T>()
        //{
        //    return new Repository<T>(_dbContext, _currentUser);
        //}

        public int SaveChanges()
        {
            try
            {
                var entries = SaveChangeDetail();
                foreach (var e in entries)
                {
                    var entity = e.Entity;
                    switch (e.State)
                    {
                    case EntityState.Added:
                        Console.WriteLine("==== State Add ====");
                        break;

                    case EntityState.Modified:
                        Console.WriteLine("==== State Modified ====");
                        break;
                    }
                }
                return(_dbContext.SaveChanges());
            }
            catch (DbEntityValidationException e)
            {
                throw new Exception(e.Message);
            }
        }
        //public IRepository<T> Repository<T>()
        //{
        //    return new Repository<T>(_dbContext, _currentUser);
        //}

        public int SaveChanges()
        {
            try
            {
                SaveChangeDetail();
                return(_dbContext.SaveChanges());
            }
            catch (DbEntityValidationException e)
            {
                throw new Exception(e.Message);
            }
        }