public ActionResult Delete(int id) { var response = _measurementService.Delete(id); TempData["IsSuccess"] = response.IsSuccess; TempData["Message"] = response.Message; return(RedirectToAction("Index")); }
public IHttpActionResult Delete(int key) { try { if (!_MeasurementSvc.Delete(key)) { return(NotFound()); } _data.SaveChanges(); } catch (Exception ex) { return(InternalServerError(ex)); } return(StatusCode(HttpStatusCode.NoContent)); }