Exemple #1
0
        public ClassDayEditViewModel Update(ClassDayEditViewModel ClassDayEditViewModel)
        {
            ClassDay ClassDay = ClassDayRepo.Update(ClassDayEditViewModel.ToModel());

            unitOfWork.commit();
            return(ClassDay.ToEditableViewModel());
        }
Exemple #2
0
        public static ClassDayEditViewModel ToEditableViewModel(this ClassDay Model)
        {
            return(new ClassDayEditViewModel()
            {
                ID = Model.ID,

                ClassRoomID = Model.ClassRoomID,
                DayID = Model.DayID,
            });
        }
Exemple #3
0
        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())
            });
        }