public OutputViewModel PrepareRegionModel(Authority region, int orgsInRegionCount, IEnumerable <Authority> hauntedAuthoritiesInRegion) { if (region == null) { throw new ArgumentNullException("region"); } if (hauntedAuthoritiesInRegion == null) { throw new ArgumentNullException("hauntedAuthoritiesInRegion"); } var authorityLinks = hauntedAuthoritiesInRegion.Select(authority => new PageLinkModel { Text = authority.Name, Title = authority.Name, Filename = authority.CleanQualifiedName, Total = authority.HauntedPubCount }).ToList(); var next = region.ExtractNextLink(); var model = OutputViewModel.CreateRegionOutputViewModel( region, orgsInRegionCount, authorityLinks, next, "Haunted pubs in {0}" ); return(model); }
public OutputViewModel PrepareAuthorityModel(Authority authority, List <PageLinkModel> localities, int count) { if (authority == null) { throw new ArgumentNullException("authority"); } if (localities == null) { throw new ArgumentNullException("localities"); } var next = authority.ExtractNextLink(); // dpc - cheshire-west-and-chester-ua.html should contain links to localities, such as: duddon-in-cheshire-west-and-chester-ua.html var model = OutputViewModel.CreateAuthorityOutputViewModel( authority, count, localities, next, "Haunted pubs in {0}" ); return(model); }