public ActionResult Delete(int id) { var handler = new CompanyHandler(); var model = handler.Get(id); if (model != null) { return(View(model)); } else { return(HttpNotFound()); } }
public HttpResponseMessage Get(int id) { var handler = new CompanyHandler(); try { var company = handler.Get(id); if (company != null) { return(Request.CreateResponse(HttpStatusCode.OK, company)); } else { throw new HttpResponseException(HttpStatusCode.NotFound); } } catch (Exception e) { throw new HttpResponseException(HttpStatusCode.InternalServerError); } }