public void Add(Shift shift) { EFShift newShift = new EFShift() { Start = shift.Start, End = shift.End }; _db.Shifts.Add(newShift); _db.SaveChanges(); }
public void UpdateById(int id, Shift shift) { EFShift newVersion = Converter.ToEfShift(shift); var result = _db.Shifts.SingleOrDefault(s => s.ShiftId == id); if (result != null) { result.ShiftId = newVersion.ShiftId; result.Start = newVersion.Start; result.End = newVersion.End; _db.SaveChanges(); } }