Exemple #1
0
        public IEnumerable <HotSpotView> QueryHotSpotViews()
        {
            var results =
                _repository.GetAllList(x => x.InfrastructureType == InfrastructureType.HotSpot)
                .MapTo <IEnumerable <HotSpotView> >();

            return(results);
        }
Exemple #2
0
        public IEnumerable <AreaBoundaryView> GetAreaBoundaryViews()
        {
            var areaDefs = _infrastructureRepository.GetAllList(x => x.HotspotType == HotspotType.AreaDef);

            return(areaDefs.Select(area =>
            {
                var coor = _boundaryRepository.FirstOrDefault(x => x.TownId == area.Id);
                if (coor == null)
                {
                    return null;
                }
                return new AreaBoundaryView
                {
                    AreaName = area.HotspotName,
                    AreaType = area.InfrastructureType.GetEnumDescription(),
                    BoundaryGeoPoints = coor.CoorList()
                };
            }).Where(x => x != null));
        }