コード例 #1
0
        public async Task <IEnumerable <KudosShopItemViewModel> > GetKudosShopItems()
        {
            var userOrganization   = GetUserAndOrganization();
            var kudosShopItemsTask = await _kudosShopService.GetAllItemsAsync(userOrganization);

            var kudosShopItems = _mapper.Map <IEnumerable <KudosShopItemDto>, IEnumerable <KudosShopItemViewModel> >(kudosShopItemsTask);

            return(kudosShopItems);
        }
コード例 #2
0
        public async Task <IHttpActionResult> GetAllItems()
        {
            var userOrganization = GetUserAndOrganization();
            var allListDto       = await _kudosShopService.GetAllItemsAsync(userOrganization);

            var result = _mapper.Map <IEnumerable <KudosShopItemDto>, IEnumerable <KudosShopItemViewModel> >(allListDto);

            return(Ok(result));
        }