public static void deleteCourse(Course course) { BasicSchoolDbContext db = new BasicSchoolDbContext(); db.Entry(course).State = EntityState.Deleted; db.Courses.Remove(course); db.SaveChanges(); }
public static void createSection(Section section) { BasicSchoolDbContext db = new BasicSchoolDbContext(); db.Entry(section).State = EntityState.Added; db.Sections.Add(section); db.SaveChanges(); }
public static void deleteSection(Section section) { BasicSchoolDbContext db = new BasicSchoolDbContext(); db.Entry(section).State = EntityState.Deleted; db.Sections.Remove(section); db.SaveChanges(); }
public static void createCourse(Course course) { BasicSchoolDbContext db = new BasicSchoolDbContext(); db.Entry(course).State = EntityState.Added; db.Courses.Add(course); db.SaveChanges(); }
public static void editSection(Section section) { BasicSchoolDbContext db = new BasicSchoolDbContext(); db.Entry(section).State = EntityState.Modified; db.SaveChanges(); }
public static void editCourse(Course course) { BasicSchoolDbContext db = new BasicSchoolDbContext(); db.Entry(course).State = EntityState.Modified; db.SaveChanges(); }