public IActionResult UpdateShift(UpdateShiftViewModel shift) { BasePolicemanShiftVM newshift = _mapper.Map <BasePolicemanShiftVM>(_policePresentation.UpdateShift(shift)); return(Json(newshift)); }
public PoliceShift UpdateShift(UpdateShiftViewModel shift) { PoliceShift oldshift = _shiftRepo.GetAllAsIQueryable() .FirstOrDefault(x => x.Id == shift.Id); oldshift.StartDate = shift.StartDate; oldshift.EndDate = shift.EndDate; _shiftRepo.Save(oldshift); return(oldshift); }