示例#1
0
        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));
        }
示例#2
0
        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));
        }