public PeopleModel Adapt(IPublishedContent content)
 {
     return(new PeopleModel
     {
         People = content.Children.Select(x => _personModelAdapter.Adapt(x))
     });
 }
 public ProductsModel Adapt(IPublishedContent content)
 {
     return(new ProductsModel
     {
         Products = content.Children.Select(x => _productModelAdapter.Adapt(x))
     });
 }
Example #3
0
 public MasterModel Adapt(IPublishedContent content)
 {
     return(new MasterModel
     {
         TopNavigation = content.AncestorsOrSelf(1).First().Children().Where(x => x.IsVisible())
                         .Select(x => _metaDataModelAdapter.Adapt(x))
     });
 }
 public InitialState Adapt(IPublishedContent content)
 {
     return(new InitialState
     {
         MetaData = _metaModelAdapter.Adapt(content),
         Request = _requestModelAdapter.Adapt(content)
     });
 }
        private ActionResult NonAjaxRequest(IPublishedContent content)
        {
            var initialState       = CreateInitialState(content);
            var masterInitialState = _masterModelAdapter.Adapt(content);

            masterInitialState.InitialState = initialState;
            return(View("Master", masterInitialState));
        }
 public ProductModel Adapt(IPublishedContent content)
 {
     return(new ProductModel
     {
         ProductDetails = _productDetailsModelAdapter.Adapt(content),
         Features = content.GetPropertyValue <IEnumerable <IPublishedContent> >("features")
                    .Select(x => _featureModelAdapter.Adapt(x))
     });
 }
Example #7
0
 public PersonModel Adapt(IPublishedContent content)
 {
     return(new PersonModel
     {
         Name = content.Name,
         DetailsModel = _detailsModelAdapter.Adapt(content),
         Social = _socialModelAdapter.Adapt(content)
     });
 }
 public DetailsModel Adapt(IPublishedContent content)
 {
     return(new DetailsModel
     {
         Photo = _imageModelAdapter.Adapt(content.GetTypedMediaByAlias("photo")),
         Department = content.GetPropertyValue <string>("department"),
         Email = content.GetPropertyValue <string>("email")
     });
 }
Example #9
0
 public HomeModel Adapt(IPublishedContent content)
 {
     return(new HomeModel
     {
         Hero = _heroModelAdapter.Adapt(content),
         Content = content.GetGridHtml("bodyText", "bootstrap3-fluid").ToHtmlString(),
         FooterHomeModel = _footerModelAdapter.Adapt(content)
     });
 }
Example #10
0
 public HeroModel Adapt(IPublishedContent content)
 {
     return(new HeroModel
     {
         Header = content.GetPropertyValue <string>("heroHeader"),
         Description = content.GetPropertyValue <string>("heroDescription"),
         CallToActionCaption = content.GetPropertyValue <string>("heroCTACaption"),
         CallToActionLink = content.GetPropertyValue <string>("HeroCtalink"),
         HeroBackground = _imageModelAdapter.Adapt(content.GetTypedMediaByAlias("HeroBackgroundImage"))
     });
 }
        public BlogModel Adapt(IPublishedContent content)
        {
            var numberOfBlopostToShown = content.GetPropertyValue <int>("howManyPostsShouldBeShown");
            var blogPost = content.Children.OrderByDescending(x => x.CreateDate).Take(numberOfBlopostToShown)
                           .Select(y => _blodPostModelAdapter.Adapt(y));

            return(new BlogModel
            {
                BlogPost = blogPost
            });
        }
        protected override InitialState CreateInitialState(IPublishedContent content)
        {
            var homeModel = _homeModelAdapter.Adapt(content);

            return(AdaptInitialState(content, homeModel));
        }
Example #13
0
        protected override InitialState CreateInitialState(IPublishedContent content)
        {
            var blogPostModel = _blogpostModelAdapter.Adapt(content);

            return(AdaptInitialState(content, blogPostModel));
        }
        protected override InitialState CreateInitialState(IPublishedContent content)
        {
            var people = _peopleModelAdapter.Adapt(content);

            return(AdaptInitialState(content, people));
        }
        protected virtual InitialState CreateInitialState(IPublishedContent content)
        {
            var initialState = _initialStateModelAdapter.Adapt(content);

            return(initialState);
        }
        protected override InitialState CreateInitialState(IPublishedContent content)
        {
            var productModel = _productsModelAdapter.Adapt(content);

            return(AdaptInitialState(content, productModel));
        }
 public ProductDetailsModel Adapt(IPublishedContent content)
 {
     return(new ProductDetailsModel
     {
         Name = content.GetPropertyValue <string>("productName"),
         Price = content.GetPropertyValue <double>("price"),
         Category = content.GetPropertyValue <IEnumerable <string> >("category"),
         Description = content.GetPropertyValue <string>("description"),
         Sku = content.GetPropertyValue <string>("sku"),
         Photos = content.GetPropertyValue <IEnumerable <IPublishedContent> >("photos").Select(x => _imageModelAdapter.Adapt(x))
     });
 }