Exemplo n.º 1
0
        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);
        }