Inheritance: People
Ejemplo n.º 1
0
 public Student UpdateStudentFromStudentEditModel(StudentEditModel studentEditModel, Student student)
 {
     student.FirstName = studentEditModel.FirstName;
     student.LastName = studentEditModel.LastName;
     student.FullName = (studentEditModel.FirstName + " " + studentEditModel.LastName).Trim();
     student.Country = studentEditModel.Country;
     student.IdNumber = studentEditModel.IdNumber;
     student.BirthDate = studentEditModel.BirthDate;
     student.Gender = Utilities.IsMasculino(studentEditModel.Gender);
     student.Nationality = studentEditModel.Nationality;
     student.State = studentEditModel.State;
     student.City = studentEditModel.City;
     student.Address = studentEditModel.Address;
     student.Biography = studentEditModel.Biography;
     student.StartDate = studentEditModel.StartDate;
     student.BloodType = studentEditModel.BloodType;
     student.AccountNumber = studentEditModel.AccountNumber;
     student.Tutor1 = studentEditModel.FirstParent;
     student.Tutor2 = studentEditModel.SecondParent;
     return Update(student);
 }
Ejemplo n.º 2
0
 public Student Create(Student itemToCreate)
 {
     var student = _context.Students.Add(itemToCreate);
     _context.SaveChanges();
     return student;
 }
Ejemplo n.º 3
0
 public Student Update(Student itemToUpdate)
 {
     _context.SaveChanges();
     return itemToUpdate;
 }