public void Update(T entity)
 {
     try
     {
         _dbContext.Entry(entity).State = EntityState.Modified;
         _dbContext.SaveChanges();
     }
     catch (Exception ex)
     {
         _log.LogError(ex, "An unexpected exception occured,\nMethodName:" + System.Reflection.MethodBase.GetCurrentMethod().Name + "\nClassname=" + this.GetType().Name, LogLevel.Error);
         throw ex;
     }
 }
Ejemplo n.º 2
0
 public void Update(T entity)
 {
     try
     {
         entity.UpdatedDate             = Helpers.UTC_To_IST();//Rita 3-11-2018 no need to set at all type
         _dbContext.Entry(entity).State = EntityState.Modified;
         _dbContext.SaveChanges();
     }
     catch (Exception ex)
     {
         _log.LogError(ex, "An unexpected exception occured,\nMethodName:" + System.Reflection.MethodBase.GetCurrentMethod().Name + "\nClassname=" + this.GetType().Name, LogLevel.Error);
         throw ex;
     }
 }
 public void Update(T entity)
 {
     _dbContext.Entry(entity).State = EntityState.Modified;
     _dbContext.SaveChanges();
 }
Ejemplo n.º 4
0
        public virtual void Add(T entity)
        {
            EntityEntry dbEntityEntry = _context.Entry <T>(entity);

            _context.Set <T>().Add(entity);
        }