private void DeleteNearBy(NearBy nearBy) { DataServiceNearBy dsNear = new DataServiceNearBy(); dsNear.DeleteNearBy(nearBy); NearByList.Remove(nearBy); }
public IHttpActionResult PutNearBy(int id, NearBy nearBy) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } if (id != nearBy.NearBys_id) { return(BadRequest()); } db.Entry(nearBy).State = EntityState.Modified; try { db.SaveChanges(); } catch (DbUpdateConcurrencyException) { if (!NearByExists(id)) { return(NotFound()); } else { throw; } } return(StatusCode(HttpStatusCode.NoContent)); }
private void AddNearBy() { DataServiceNearBy dsNear = new DataServiceNearBy(); NearBy nearBy = new NearBy(); Tour.NearBy.Add(nearBy); nearBy.Tour = Tour; dsNear.addNearBy(nearBy); NearByList.Add(nearBy); }
public IHttpActionResult GetNearBy(int id) { NearBy nearBy = db.NearBys.Find(id); if (nearBy == null) { return(NotFound()); } return(Ok(nearBy)); }
public IHttpActionResult PostNearBy(NearBy nearBy) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } db.NearBys.Add(nearBy); db.SaveChanges(); return(CreatedAtRoute("DefaultApi", new { id = nearBy.NearBys_id }, nearBy)); }
public IHttpActionResult DeleteNearBy(int id) { NearBy nearBy = db.NearBys.Find(id); if (nearBy == null) { return(NotFound()); } db.NearBys.Remove(nearBy); db.SaveChanges(); return(Ok(nearBy)); }
public void DeleteNearBy(NearBy nearBy) { nearBy.Tour.NearBy.Remove(nearBy); db.nearBy.DeleteOnSubmit(nearBy); }
public void addNearBy(NearBy newNearBy) { db.nearBy.InsertOnSubmit(newNearBy); }