Exemple #1
0
        public async Task <ActionResult <APIResponseWrapper <ItemDTO> > > GetItemById(int itemId)
        {
            var item = await itemBusinessLogic.GetItemById(itemId);

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

            var itemDTO = item.ToDTO();

            return(APIResponseWrapper <ItemDTO> .StatusComplete(itemDTO));
        }
Exemple #2
0
        public async Task <ActionResult <APIResponseWrapper <ItemDTO[]> > > GetAllItems()
        {
            var items = await itemBusinessLogic.GetAllItems();

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

            var itemDTO    = items.Select(c => c.ToDTO()).ToArray();
            var itemResult = APIResponseWrapper <ItemDTO[]> .StatusComplete(itemDTO);

            return(itemResult);
        }