コード例 #1
0
ファイル: LessonDAL.cs プロジェクト: Vovka1994/UniPlanner
 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);
 }
コード例 #2
0
 //public virtual void Add(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.Add(lesson);
 //}
 //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 virtual void Edit(LessonDto entity)
 {
     _entities.Entry(entity).State = EntityState.Modified;//??
 }
コード例 #3
0
ファイル: LessonDAL.cs プロジェクト: Vovka1994/UniPlanner
 public LessonDto GetById(Guid id)
 {
     var x = _dbset.Find(id);
     var lessonDto = new LessonDto()
     {
         Id = x.Id,
         Sequence = x.Sequence,
         StudentGroup = x.StudentGroup,
         Room = x.Room,
         LessonType = x.LessonType,
         WeekType = x.WeekType,
         Course = x.Course,
         Semester = x.Semester,
         Day = x.Day,
         ActualYear = x.ActualYear,
         IsActive = x.IsActive
     };
     return lessonDto;
 }