コード例 #1
0
        public IActionResult UpdateShift(UpdateShiftViewModel shift)
        {
            BasePolicemanShiftVM newshift =
                _mapper.Map <BasePolicemanShiftVM>(_policePresentation.UpdateShift(shift));

            return(Json(newshift));
        }
コード例 #2
0
ファイル: PolicePresentation.cs プロジェクト: zahavr/Kz2021p1
        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);
        }