public ActionResult Delete(int id, FormCollection collection) { try { service.Delete(id); return(RedirectToAction("Index")); } catch { return(View()); } }
public HttpResponseMessage DeleteVillage(int id) { var message = Request.CreateErrorResponse(HttpStatusCode.BadRequest, "Bad Request"); if (string.IsNullOrWhiteSpace(id.ToString())) { message = Request.CreateErrorResponse(HttpStatusCode.NotFound, "Invalid Id"); } else { var result = _iVillageService.Delete(id); if (result) { message = Request.CreateResponse(HttpStatusCode.OK); } } return(message); }
// DELETE: api/Village/5 public void Delete(int id) { _villageService.Delete(id); }
public void Delete() { Assert.IsTrue(service.Delete(1)); }