Beispiel #1
0
        public IHttpActionResult Get(int id)
        {
            if (id == 0)
            {
                return(BadRequest());
            }
            var checkList = checklistRepository.Get(id);

            if (checkList == null)
            {
                return(NotFound());
            }
            var result         = Mapper.Map <CheckListDisplayVM>(checkList);
            var checkListItems = checklistRepository.GetChecklistChild(checkList.Id);

            result.Items = Mapper.Map <List <CheckListItem> >(checkListItems);

            return(Ok(result));
        }