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); }
public async Task <IActionResult> GetSearchHints(string subSearchQuery, SpecifiedAmountModel specifiedAmountModel) { return(Ok(await _discountService.GetSearchHintsAsync(subSearchQuery, specifiedAmountModel))); }
public async Task <IEnumerable <string> > GetSearchHintsAsync(string subSearchQuery, SpecifiedAmountModel specifiedAmountModel) { return(await _discountRepository.SearchHintsAsync(subSearchQuery, specifiedAmountModel.Take)); }
public async Task <IEnumerable <TagDTO> > GetSpecifiedAmountAsync(SpecifiedAmountModel specifiedAmountModel) { var tags = await _tagRepository.GetPopularTagsAsync(specifiedAmountModel.Skip, specifiedAmountModel.Take); return(_mapper.Map <TagDTO[]>(tags)); }
public async Task <IActionResult> GetTags(SpecifiedAmountModel specifiedAmountModel) { return(Ok(await _tagService.GetSpecifiedAmountAsync(specifiedAmountModel))); }
public async Task <IActionResult> GetUserTickets(SpecifiedAmountModel specifiedAmountModel) { return(Ok(await _userService.GetUserTicketsAsync(await _userManager.FindByNameAsync(User.Identity.Name), specifiedAmountModel))); }