示例#1
0
        public IViewModel Build(BannerRequest req)
        {
            var topBanners = _bannerRepo.GetAllBanners($"Product-TopBanner");

            topBanners = FilterTopBanner(topBanners, req);

            var bottomBanners = _bannerRepo.GetAllBanners("Product-BottomBanner");

            bottomBanners = FilterBottomBanner(bottomBanners, req);

            return(new ProductBannerViewModel()
            {
                TopBanners = topBanners.Cast <ProductTopBanner>(),
                BottomBanners = bottomBanners.Cast <ProductBottomBanner>()
            });
        }
示例#2
0
        public IViewModel Build(BannerRequest req)
        {
            var banners = _bannerRepo.GetAllBanners("HeroBannerId");

            banners = FilterBanners(banners, req);
            return(new HeroBannerViewModel()
            {
                Banners = banners.Cast <HeroBannerViewModel>()
            });
        }