public async Task <IActionResult> All(int page = 1) { if (page <= 0) { return(this.NotFound()); } var viewModel = new InquiriesViewModel { ItemsPerPage = ItemsPerPage, CurrentPage = page, InquiriesCount = await this.inquiriesService.GetCountAsync(), Inqueries = await this.inquiriesService.GetAllAsync <IndexInquiryViewModel>(page, ItemsPerPage), }; return(this.View(viewModel)); }
public async Task <IActionResult> AllById(int page = 1) { if (page <= 0) { return(this.NotFound()); } var claimsIdentity = (ClaimsIdentity)this.User.Identity; var claim = claimsIdentity.FindFirst(ClaimTypes.NameIdentifier); var userId = claim.Value; var viewModel = new InquiriesViewModel { ItemsPerPage = ItemsPerPage, CurrentPage = page, InquiriesCount = await this.inquiriesService.GetCountAsync(userId), Inqueries = await this.inquiriesService.GetAllAsync <IndexInquiryViewModel>(page, ItemsPerPage, userId), }; return(this.View(viewModel)); }