예제 #1
0
        public static IQueryable <Models.Industry> Get(SizeUpContext context, List <long> ids)
        {
            var p = new Projections.Industry.Default();

            return(Get(context)
                   .Where(i => ids.Contains(i.Id))
                   .Select(p.Expression));
        }
예제 #2
0
        public static Models.Industry GetLegacy(SizeUpContext context, string SEOKey)
        {
            var p = new Projections.Industry.Default();

            return(Get(context)
                   .Where(i => i.LegacyIndustrySEOKeys.Any(l => l.SEOKey == SEOKey))
                   .Select(p.Expression)
                   .FirstOrDefault());
        }
예제 #3
0
        public static Models.Industry Get(SizeUpContext context, long?id)
        {
            var p = new Projections.Industry.Default();

            return(Get(context)
                   .Where(i => i.Id == id)
                   .Select(p.Expression)
                   .FirstOrDefault());
        }
예제 #4
0
        public static IQueryable <Models.Industry> ListInPlace(SizeUpContext context, long placeId)
        {
            var p = new Projections.Industry.Default();

            return(context.Industries
                   .SelectMany(i => i.IndustryDatas, (i, o) => new { Industry = i, IndustryData = o })
                   .Where(i => i.Industry.IsActive && !i.Industry.IsDisabled)
                   .Where(i => i.IndustryData.Year == CommonFilters.TimeSlice.Industry.Year && i.IndustryData.Quarter == CommonFilters.TimeSlice.Industry.Quarter)
                   .Where(i => i.IndustryData.GeographicLocation.City.Places.Any(pl => pl.Id == placeId))
                   .Where(i => i.IndustryData.BusinessCount > 0)
                   .Select(i => i.Industry)
                   .Select(p.Expression));
        }