// GET: api/Contact/5 public HttpResponseMessage Get(int id) { var contact = _contactServices.GetById(id); return(contact != null ? Request.CreateResponse(HttpStatusCode.OK, contact) : Request.CreateErrorResponse(HttpStatusCode.NotFound, "No Contact found for this id")); }
// GET: Admin/Contacts/Details/5 public ActionResult Details(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } Contact contact = _contact.GetById(id); if (contact == null) { return(HttpNotFound()); } return(View(contact)); }