public IActionResult Delete(int id) { var result = _customerService.Delete(id); if (result.Success) { return(Ok(result)); } return(BadRequest(result)); }
// DELETE api/apartments/5 public HttpResponseMessage Delete(long id) { try { _apartmentService.Delete(id); return(Request.CreateResponse(System.Net.HttpStatusCode.Accepted)); } catch { return(Request.CreateResponse(System.Net.HttpStatusCode.InternalServerError)); } }
public HttpResponseMessage Delete(HttpRequestMessage request, int id) { return(CreateHttpResponse(request, () => { HttpResponseMessage response = null; if (!ModelState.IsValid) { response = request.CreateResponse(HttpStatusCode.BadRequest, ModelState); } else { var oldApartment = _apartmentService.Delete(id); _apartmentService.SaveChanges(); var responseData = Mapper.Map <Apartment, ApartmentViewModel>(oldApartment); response = request.CreateResponse(HttpStatusCode.Created, responseData); } return response; })); }
public ActionResult Delete(int id) { return(Ok(apartmentService.Delete(id))); }
public IActionResult Delete(string id) { _apartmentService.Delete(id); return(RedirectToAction("Index", "Owner")); }
public async Task Delete(Guid id) { await _apartmentService.Delete(id); }