public IHttpActionResult PostSchoolLocated(SchoolLocated schoolLocated) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } db.SchoolLocateds.Add(schoolLocated); try { db.SaveChanges(); } catch (DbUpdateException) { if (SchoolLocatedExists(schoolLocated.SchoolLocated1)) { return(Conflict()); } else { throw; } } return(CreatedAtRoute("DefaultApi", new { id = schoolLocated.SchoolLocated1 }, schoolLocated)); }
public IHttpActionResult PutSchoolLocated(string id, SchoolLocated schoolLocated) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } if (id != schoolLocated.SchoolLocated1) { return(BadRequest()); } db.Entry(schoolLocated).State = EntityState.Modified; try { db.SaveChanges(); } catch (DbUpdateConcurrencyException) { if (!SchoolLocatedExists(id)) { return(NotFound()); } else { throw; } } return(StatusCode(HttpStatusCode.NoContent)); }
public IHttpActionResult GetSchoolLocated(string id) { SchoolLocated schoolLocated = db.SchoolLocateds.Find(id); if (schoolLocated == null) { return(NotFound()); } return(Ok(schoolLocated)); }
public IHttpActionResult DeleteSchoolLocated(string id) { SchoolLocated schoolLocated = db.SchoolLocateds.Find(id); if (schoolLocated == null) { return(NotFound()); } db.SchoolLocateds.Remove(schoolLocated); db.SaveChanges(); return(Ok(schoolLocated)); }