예제 #1
0
        public static Linklist ToShopifyModel(this StorefrontModel.MenuLinkList storefrontModel, Storefront.Model.WorkContext workContext, IStorefrontUrlBuilder urlBuilder)
        {
            var shopifyModel = new Linklist();

            shopifyModel.Handle = storefrontModel.Name;
            shopifyModel.Id     = storefrontModel.Id;
            shopifyModel.Links  = storefrontModel.MenuLinks.Select(ml => ml.ToShopfiyModel(workContext, urlBuilder)).ToList();
            shopifyModel.Title  = storefrontModel.Name;

            return(shopifyModel);
        }
        public static Linklist ToShopifyModel(this StorefrontModel.MenuLinkList storefrontModel)
        {
            var shopifyModel = new Linklist();

            shopifyModel.Handle = storefrontModel.Name;
            shopifyModel.Id     = storefrontModel.Id;
            shopifyModel.Links  = storefrontModel.MenuLinks.Select(ml => ml.ToShopfiyModel()).ToList();
            shopifyModel.Title  = storefrontModel.Name;

            return(shopifyModel);
        }
        public virtual Linklist ToLiquidLinklist(StorefrontModel.MenuLinkList linkList, Storefront.Model.WorkContext workContext, IStorefrontUrlBuilder urlBuilder)
        {
            var result = new Linklist();

            result.Id     = linkList.Id;
            result.Handle = linkList.Name.Handelize();
            result.Links  = linkList.MenuLinks.Select(ml => ToLiquidLink(ml, workContext, urlBuilder)).ToList();
            result.Title  = linkList.Name;

            return(result);
        }
예제 #4
0
        public virtual Linklist ToLiquidLinklist(StorefrontModel.MenuLinkList linkList, Storefront.Model.WorkContext workContext, IStorefrontUrlBuilder urlBuilder)
        {
            var result = new Linklist();

            result.InjectFrom <StorefrontModel.Common.NullableAndEnumValueInjecter>(linkList);

            result.Handle = linkList.Name;
            result.Links  = linkList.MenuLinks.Select(ml => ToLiquidLink(ml, workContext, urlBuilder)).ToList();
            result.Title  = linkList.Name;

            return(result);
        }
예제 #5
0
        public virtual Linklist ToLiquidLinklist(StorefrontModel.MenuLinkList linkList, Storefront.Model.WorkContext workContext, IStorefrontUrlBuilder urlBuilder)
        {
            var factory = ServiceLocator.Current.GetInstance <ShopifyModelFactory>();
            var result  = factory.CreateLinklist();

            result.InjectFrom <StorefrontModel.Common.NullableAndEnumValueInjecter>(linkList);

            result.Handle = linkList.Name;
            result.Links  = linkList.MenuLinks.Select(ml => ToLiquidLink(ml, workContext, urlBuilder)).ToList();
            result.Title  = linkList.Name;

            return(result);
        }
예제 #6
0
        public static MenuLinkList ToWebModel(this VirtoCommerceContentWebModelsMenuLinkList serviceModel, IStorefrontUrlBuilder urlBuilder)
        {
            var webModel = new MenuLinkList();

            webModel.InjectFrom(serviceModel);

            if (serviceModel.MenuLinks != null)
            {
                webModel.MenuLinks = serviceModel.MenuLinks.Select(ml => ml.ToWebModel(urlBuilder)).ToList();
            }
            if (serviceModel.SecurityScopes != null)
            {
                webModel.SecurityScopes = serviceModel.SecurityScopes.Select(ss => ss).ToList();
            }

            return webModel;
        }
예제 #7
0
        public static Linklist ToShopifyModel(this StorefrontModel.MenuLinkList linkList, Storefront.Model.WorkContext workContext, IStorefrontUrlBuilder urlBuilder)
        {
            var converter = ServiceLocator.Current.GetInstance <ShopifyModelConverter>();

            return(converter.ToLiquidLinklist(linkList, workContext, urlBuilder));
        }
        public static Linklist ToShopifyModel(this StorefrontModel.MenuLinkList linkList, Storefront.Model.WorkContext workContext, IStorefrontUrlBuilder urlBuilder)
        {
            var converter = new ShopifyModelConverter();

            return(converter.ToLiquidLinklist(linkList, workContext, urlBuilder));
        }