Пример #1
0
        /* GET api/<controller>/5  This Get() will return a
         * specific task taking argument userTaskId, and returning
         * an error if it is not found in the database.
         */
        public HttpResponseMessage Get(int userTaskId)
        {
            var specificTask = Repo.GetUserTaskById(userTaskId);

            if (specificTask == null)
            {
                return(Request.CreateResponse(HttpStatusCode.NotFound));
            }
            else
            {
                return(Request.CreateResponse(specificTask));
            }
        }