public ClassDayEditViewModel Update(ClassDayEditViewModel ClassDayEditViewModel) { ClassDay ClassDay = ClassDayRepo.Update(ClassDayEditViewModel.ToModel()); unitOfWork.commit(); return(ClassDay.ToEditableViewModel()); }
public static ClassDayEditViewModel ToEditableViewModel(this ClassDay Model) { return(new ClassDayEditViewModel() { ID = Model.ID, ClassRoomID = Model.ClassRoomID, DayID = Model.DayID, }); }
public static ClassDayViewModel ToViewModel(this ClassDay Model) { return(new ClassDayViewModel() { ID = Model.ID, ClassRoomID = Model.ClassRoomID, ClassRoom = Model.ClassRoom.ToViewModel(), DayID = Model.DayID, Day = Model.Day.ToViewModel(), ClassLessons = Model.ClassLessons.Select(i => i.ToViewModel()) }); }