/// <summary> /// Add a new School /// </summary> /// <param name="School">The School to add</param> /// <returns>True if School is added successfuly otherwise false</returns> public bool AddSchool(SCHOOL school) { if (school != null) { db.SCHOOLs.Add(school); db.SaveChanges(); return(true); } return(false); }
/// <summary> /// Update a school /// </summary> /// <param name="school">school object</param> public void EditSchool(SCHOOL school) { // Change the state of the school object to modified, so it will be update in database db.Entry(school).State = EntityState.Modified; db.SaveChanges(); }