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