public TimeEntry Update(long id, TimeEntry timeEntry) { var RecordToUpdate = timeEntry.ToRecord(); RecordToUpdate.Id = id; _context.Update(RecordToUpdate); _context.SaveChanges(); return(Find(id)); }
public TimeEntry Update(long id, TimeEntry timeEntry) { var updatedrecord = timeEntry.ToRecord(); updatedrecord.Id = id; _timeentrycontext.Update(updatedrecord); _timeentrycontext.SaveChanges(); return(Find(updatedrecord.Id.Value)); }
public TimeEntry Update(long id, TimeEntry timeEntry) { TimeEntryRecord theUpdatedRecord = timeEntry.ToRecord(); theUpdatedRecord.Id = id; Context.Update(theUpdatedRecord); Context.SaveChanges(); return(Find(id)); }
public TimeEntry Update(long id, TimeEntry timeEntry) { var recToUpd = timeEntry.ToRecord(); recToUpd.Id = id; _timeEntryContext.Update(recToUpd); _timeEntryContext.SaveChanges(); return(Find(id)); }
public TimeEntry Update(long id, TimeEntry timeEntry) { TimeEntryRecord timeEntryRecord = _context.Find <TimeEntryRecord>(id); timeEntryRecord.UserId = timeEntry.UserId; timeEntryRecord.ProjectId = timeEntry.ProjectId; timeEntryRecord.Date = timeEntry.Date; timeEntryRecord.Hours = timeEntry.Hours; _context.Update(timeEntryRecord); _context.SaveChanges(); return(timeEntryRecord.ToEntity()); }