public IHttpActionResult Get(int id) { if (id <= 0) { return(BadRequest("ID should be positive")); } var award = awardDm.GetAwardByID(id); if (award == null) { return(NotFound()); } return(Json(award)); }
public ActionResult Details(int?id) { if (!id.HasValue) { return(RedirectToAction(nameof(Index))); } var award = awardDm.GetAwardByID((int)id); if (award == null) { return(HttpNotFound()); } ViewBag.Breadcrumb = new Breadcrumb("award", null, award.Title); return(View(award)); }