Пример #1
0
 public Grade GenerateGradeFromRegisterModel(Grade gradeRegisterModel)
 {
     return new Grade
     {
         Name = gradeRegisterModel.Name,
         EducationLevel = gradeRegisterModel.EducationLevel
     };
 }
Пример #2
0
 public Grade UpdateGradeFromGradeEditModel(Grade gradeEditModel, Grade grade)
 {
     grade.Name = gradeEditModel.Name;
     grade.EducationLevel = gradeEditModel.EducationLevel;
     return Update(grade);
 }
Пример #3
0
 public Grade Update(Grade itemToUpdate)
 {
     _context.Entry(itemToUpdate).State = EntityState.Modified;
     _context.SaveChanges();
     return itemToUpdate;
 }
Пример #4
0
 public Grade Create(Grade itemToCreate)
 {
     var grade = _context.Grades.Add(itemToCreate);
     _context.SaveChanges();
     return grade;
 }