Ejemplo n.º 1
0
        public ActionResult BannerHomeProduct()
        {
            var banners = _bannerService.FindBy(
                x => x.Status == 1 && x.PageBanner.Position == 10 &&
                (!x.FromDate.HasValue || DbFunctions.DiffHours(x.ToDate.Value, DateTimeOffset.UtcNow.Offset) >= 0) &&
                (!x.ToDate.HasValue || DbFunctions.DiffHours(x.ToDate.Value, DateTimeOffset.UtcNow.Offset) <= 0));

            return(PartialView(banners));
        }