コード例 #1
0
        //[ChildActionOnly]
        public ActionResult Logo()
        {
            var model = new HomeHeaderModel();
            var Logo  = _pictureService.GetHomeLogo();

            if (Logo != null)
            {
                model.LogoEnabled = true;
                model.pictures    = new EF.Core.Data.Picture
                {
                    AlternateText = Logo.AlternateText,
                    CreatedOn     = Logo.CreatedOn,
                    Height        = Logo.Height,
                    Id            = Logo.Id,
                    IsActive      = Logo.IsActive,
                    IsLogo        = Logo.IsLogo,
                    IsThumb       = Logo.IsThumb,
                    Size          = Logo.Size,
                    Url           = Logo.Url,
                    UserId        = Logo.UserId,
                    Width         = Logo.Width
                };
            }

            return(PartialView("_logo", model));
        }
コード例 #2
0
        public ActionResult Index()
        {
            var getLogo = _pictureService.GetHomeLogo();
            var model   = new HomeHeaderModel();

            if (getLogo != null && !string.IsNullOrEmpty(getLogo.Url))
            {
                model.LogoEnabled = true;
                model.pictures    = new EF.Core.Data.Picture
                {
                    AlternateText = getLogo.AlternateText,
                    CreatedOn     = getLogo.CreatedOn,
                    Height        = getLogo.Height,
                    Id            = getLogo.Id,
                    IsActive      = getLogo.IsActive,
                    IsLogo        = getLogo.IsLogo,
                    IsThumb       = getLogo.IsThumb,
                    Size          = getLogo.Size,
                    Url           = getLogo.Url,
                    UserId        = getLogo.UserId,
                    Width         = getLogo.Width
                };
            }

            var _user = _userContext.CurrentUser;

            return(View(model));
        }