public Service Update(Service entity) { if (entity == null) { throw new ArgumentNullException(); } Service existing = context.Services.Find(entity.Id); context.Entry(existing).CurrentValues.SetValues(entity); context.SaveChanges(); return(entity); }
public Request Update(Request entity) { if (entity == null) { throw new ArgumentNullException(); } Request existing = context.Requests.Find(entity.Id); context.Entry(existing).CurrentValues.SetValues(entity); context.SaveChanges(); return(entity); }