Example #1
0
        // GET api/modes/5
        /// <summary>
        /// Gets a <see cref="Mode"/> object from the repository.
        /// </summary>
        /// <param name="id">The ID of <see cref="Mode"/>.</param>
        /// <returns>The <see cref="Mode"/> with the given ID.</returns>
        public IHttpActionResult Get(int id)
        {
            Mode item = service.Get(id);

            if (item != null)
            {
                return(Ok(item));
            }
            else
            {
                return(NotFound());
            }
        }
        public ActionResult Details(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            Mode item = service.Get(id);

            if (item != null)
            {
                return(PartialView(item));
            }
            return(HttpNotFound());
        }