Example #1
0
        //GET /api/TodoItem/{id}
        /// <summary>
        /// Retrieves the TodoItem that matches the given <paramref name="id"/>.
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public async Task <IHttpActionResult> Get(string id)
        {
            var data = await TodoItemRepository.FindByIdAndUserNameAsync(id, User.Identity.Name);

            if (data == null)
            {
                return(NotFound());
            }

            return(Ok(Models.Output.TodoItem.Project(data)));
        }