public HttpResponseMessage Delete(int id) { using (var service = new ServiceModeloNegocio.ServiceClient()) { var customer = service.GetCustomerById(id); service.DeleteCustomer(customer); return(Request.CreateResponse(HttpStatusCode.Gone)); } }
public ActionResult Delete(int id, FormCollection collection) { try { using (var service = new ServiceModeloNegocio.ServiceClient()) { var customer = service.GetCustomerById(id); service.DeleteCustomer(customer); return(RedirectToAction("Index")); } } catch { return(View("Index")); } }