public virtual void Delete(LessonDto entity) { Lesson lesson = new Lesson() { Id = entity.Id, Sequence = entity.Sequence, StudentGroup = entity.StudentGroup, Room = entity.Room, LessonType = entity.LessonType, WeekType = entity.WeekType, Course = entity.Course, Semester = entity.Semester, Day = entity.Day, ActualYear = entity.ActualYear, IsActive = entity.IsActive }; _dbset.Remove(lesson); }
public static LessonDto LessonToDto(Lesson lesson) { return new LessonDto() { Id = lesson.Id, EndTime = lesson.Sequence.EndTime, SequenceName = lesson.Sequence.SequenceName, StartTime = lesson.Sequence.StartTime, StartYear = lesson.StudentGroup.StartYear, StudentGroupName = lesson.StudentGroup.StudentGroupName, RoomName = lesson.Room.RoomName, TypeName = lesson.LessonType.TypeName, WeekName = lesson.WeekType.WeekName, CourseName = lesson.Course.CourseName, Semester = lesson.Semester, DayName = lesson.Day.DayName }; }