public virtual T Atualizar(T obj) { var entry = Db.Entry(obj); Db.Set <T>().Attach(obj); entry.State = EntityState.Modified; SaveChages(); return(obj); }
public async Task UpdateAsync(TEntity entity) { var entityDb = await _dataSet.FindAsync(entity.Id); entity.UpdateAt = DateTime.Now; entity.CreateAt = entityDb.CreateAt; _context.Entry(entityDb).CurrentValues.SetValues(entity); await _context.SaveChangesAsync(); }
public void Update(TEntity entity) { Db.Entry(entity).State = EntityState.Modified; Db.SaveChanges(); }
public void Update(TEntity obj) { ctx.Entry(obj).State = EntityState.Modified; ctx.SaveChanges(); }
public void Update(TEntity obj) { _DDDContext.Entry(obj).State = EntityState.Modified; _DDDContext.SaveChanges(); }