public Teacher Create(Teacher teacher) { _dBContextSchool.Teacher.Add(teacher); _dBContextSchool.SaveChanges(); return(teacher); }
public Student Create(Student student) { _dBContextSchool.Student.Add(student); _dBContextSchool.SaveChanges(); return(student); }
public static void init(DBContextSchool context) { context.Database.EnsureCreated(); if (context.Student.Any()) { return; } else { context.Add(new Student()); context.SaveChanges(); } }
public List <Course> GetCourses() { _dBContextSchool.SaveChanges(); return(_dBContextSchool.Course.ToList()); }