コード例 #1
0
        public async Task <IEnumerable <TicketDTO> > GetUserTicketsAsync(User user, SpecifiedAmountModel specifiedAmountModel)
        {
            var tickets = await _ticketRepository.GetTicketsAsync(user.Id, specifiedAmountModel.Skip, specifiedAmountModel.Take);

            var ticketDTOs = _mapper.Map <TicketDTO[]>(tickets);

            for (int i = 0; i < ticketDTOs.Length; i++)
            {
                ticketDTOs[i].IsSavedDiscount = await _discountRepository.IsSavedDiscountAsync(ticketDTOs[i].DiscountId, user.Id);
            }

            return(ticketDTOs);
        }
コード例 #2
0
 public async Task <IActionResult> GetSearchHints(string subSearchQuery, SpecifiedAmountModel specifiedAmountModel)
 {
     return(Ok(await _discountService.GetSearchHintsAsync(subSearchQuery, specifiedAmountModel)));
 }
コード例 #3
0
 public async Task <IEnumerable <string> > GetSearchHintsAsync(string subSearchQuery, SpecifiedAmountModel specifiedAmountModel)
 {
     return(await _discountRepository.SearchHintsAsync(subSearchQuery, specifiedAmountModel.Take));
 }
コード例 #4
0
        public async Task <IEnumerable <TagDTO> > GetSpecifiedAmountAsync(SpecifiedAmountModel specifiedAmountModel)
        {
            var tags = await _tagRepository.GetPopularTagsAsync(specifiedAmountModel.Skip, specifiedAmountModel.Take);

            return(_mapper.Map <TagDTO[]>(tags));
        }
コード例 #5
0
 public async Task <IActionResult> GetTags(SpecifiedAmountModel specifiedAmountModel)
 {
     return(Ok(await _tagService.GetSpecifiedAmountAsync(specifiedAmountModel)));
 }
コード例 #6
0
 public async Task <IActionResult> GetUserTickets(SpecifiedAmountModel specifiedAmountModel)
 {
     return(Ok(await _userService.GetUserTicketsAsync(await _userManager.FindByNameAsync(User.Identity.Name), specifiedAmountModel)));
 }