Example #1
0
        // Create student
        public StudentDTO CreateStudent(Student student)
        {
            DB.Students.Add(student);
            DB.SaveChanges();

            var dto = new StudentDTO()
            {
                Id   = student.Id,
                Name = student.Names + " " + student.Surnames
            };

            return(dto);
        }
Example #2
0
 // Register grade
 public Grade RegisterGrade(Grade grade)
 {
     DB.Grades.Add(grade);
     DB.SaveChanges();
     return(grade);
 }
Example #3
0
 // Create subject
 public Subject CreateSubject(Subject subject)
 {
     DB.Subjects.Add(subject);
     DB.SaveChanges();
     return(subject);
 }