public async Task <ClubRequestWithOptionsViewModel> GetRequest(Guid id) { var request = await _coreClubRequestService.GetRequest(id); var vm = _mapper.Map <ClubRequestWithOptionsViewModel>(request); vm.ClubOptions = _mapper.Map <IList <ClubSummaryViewModel> >(await _coreClubService.GetClubs(true)); return(vm); }
public async Task <IEnumerable <ClubDto> > Get() { var clubs = await _clubService.GetClubs(true); var filteredClubs = new List <Club>(); foreach (var club in clubs) { if (await _authService.CanUserEdit(User, club.Id)) { filteredClubs.Add(club); } } return(_mapper.Map <List <ClubDto> >(filteredClubs)); }
public async Task <ActionResult> SitemapAsync() { var preferredhost = _config["PreferredHost"]; // CDN rewrites headers, so needed to make this less dynamic. string baseUrl = $"https://{preferredhost}"; // get a list of public clubs var clubs = await _clubservice.GetClubs(false); var siteMapBuilder = new SitemapBuilder(); siteMapBuilder.AddUrl(baseUrl + webPathDelimiter, changeFrequency: ChangeFrequency.Monthly, priority: 0.8); siteMapBuilder.AddUrl(baseUrl + Url.Action("News", "Home"), changeFrequency: ChangeFrequency.Monthly, priority: 0.5); siteMapBuilder.AddUrl(baseUrl + Url.Action("About", "Home"), changeFrequency: ChangeFrequency.Monthly, priority: 0.5); foreach (var club in clubs) { siteMapBuilder.AddUrl(baseUrl + webPathDelimiter + club.Initials, priority: 1.0); } // generate the sitemap xml string xml = siteMapBuilder.ToString(); return(Content(xml, "text/xml")); }