public virtual void Update(Entity entity, int id) { entity.Build(_context); Entity old = Get(id); ValidateUpdate(entity, id); _context.Entry(old).CurrentValues.SetValues(entity); old.Update(entity); }
public virtual void Update(T entity, K Id) { Utility.Log($"REPOSOTORY: Update data.", "INFO"); T old = Get(Id); if (old != null) { context.Entry(old).CurrentValues.SetValues(entity); } }
public void Update(T entity, I id) { T old = Get(id); if (old != null) { timeKeeperContext.Entry(old).CurrentValues.SetValues(entity); Logger.Log("REPOSITORY: record updated", "INFO"); } else { Logger.Log("REPOSITORY: record not found", "ERROR"); } }