Table of Contents

Class ViewModelFactory

Namespace
Dynamicweb.Ecommerce.ProductCatalog
Assembly
Dynamicweb.Ecommerce.dll
Handles creation of all ecommerce viewmodels.
public class ViewModelFactory
Inheritance
ViewModelFactory
Inherited Members

Methods

CreateCartViewModel(Order, int?)

Creates an instance of CartViewModel .
public static CartViewModel CreateCartViewModel(Order cart, int? areaId)

Parameters

cart Order
The cart.
areaId int?

Returns

CartViewModel
CartViewModel.

CreateFieldColorValueView(string)

public static ColorViewModel CreateFieldColorValueView(string color)

Parameters

color string

Returns

ColorViewModel

CreateFieldFileValueView(string)

public static FileViewModel CreateFieldFileValueView(string filePath)

Parameters

filePath string

Returns

FileViewModel

CreateFieldLinkValueView(string)

public static LinkViewModel CreateFieldLinkValueView(string url)

Parameters

url string

Returns

LinkViewModel

CreateView(FavoriteListListViewModelSettings, IEnumerable<FavoriteList>)

public static FavoriteListListViewModel CreateView(FavoriteListListViewModelSettings settings, IEnumerable<FavoriteList> favoriteLists)

Parameters

settings FavoriteListListViewModelSettings
favoriteLists IEnumerable<FavoriteList>

Returns

FavoriteListListViewModel

CreateView(FavoriteListViewModelSettings, FavoriteList)

public static FavoriteListViewModel CreateView(FavoriteListViewModelSettings settings, FavoriteList favoriteList)

Parameters

settings FavoriteListViewModelSettings
favoriteList FavoriteList

Returns

FavoriteListViewModel

CreateView(FavoriteProductListViewModelSettings, IEnumerable<FavoriteProduct>)

public static FavoriteProductListViewModel CreateView(FavoriteProductListViewModelSettings settings, IEnumerable<FavoriteProduct> favoriteProducts)

Parameters

settings FavoriteProductListViewModelSettings
favoriteProducts IEnumerable<FavoriteProduct>

Returns

FavoriteProductListViewModel

CreateView(OrderListViewModelSettings, IEnumerable<Order>)

Creates an instance of OrderListViewModel .
[Obsolete("Use CreateView(OrderListViewModelSettings settings, IEnumerable<Order> orders, int pageCount, int totalOrdersCount) instead")]
public static OrderListViewModel CreateView(OrderListViewModelSettings settings, IEnumerable<Order> orders)

Parameters

settings OrderListViewModelSettings
Configuration of how the viewmodel should be created
orders IEnumerable<Order>
The orders.

Returns

OrderListViewModel
OrderListViewModel.

CreateView(OrderListViewModelSettings, IEnumerable<Order>, int, int)

Creates an instance of OrderListViewModel .
public static OrderListViewModel CreateView(OrderListViewModelSettings settings, IEnumerable<Order> orders, int pageCount, int totalOrdersCount)

Parameters

settings OrderListViewModelSettings
Configuration of how the viewmodel should be created
orders IEnumerable<Order>
The orders.
pageCount int
Number of pages in full result
totalOrdersCount int
Number of orders in full result

Returns

OrderListViewModel
OrderListViewModel.

CreateView(OrderViewModelSettings, Order)

Creates an instance of OrderViewModel .
public static OrderViewModel CreateView(OrderViewModelSettings settings, Order order)

Parameters

settings OrderViewModelSettings
Configuration of how the viewmodel should be created
order Order
The order.

Returns

OrderViewModel
OrderViewModel.

CreateView(ProductGroupViewModelSettings, Group)

Creates a viewmodel of a list of products.
public static ProductGroupViewModel CreateView(ProductGroupViewModelSettings settings, Group group)

Parameters

settings ProductGroupViewModelSettings
Configuration of how the viewmodel should be created
group Group

Returns

ProductGroupViewModel
productListViewModel

CreateView(ProductListViewModelSettings, IEnumerable<long>)

Creates a ViewModel of a list of products.
public static ProductListViewModel CreateView(ProductListViewModelSettings settings, IEnumerable<long> productAutoIds)

Parameters

settings ProductListViewModelSettings
Configuration of how the ViewModel should be created.
productAutoIds IEnumerable<long>
Auto-ids of the products.

Returns

ProductListViewModel
The ProductListViewModel.

CreateView(ProductListViewModelSettings, IList<string>)

Creates a viewmodel of a list of products.
public static ProductListViewModel CreateView(ProductListViewModelSettings settings, IList<string> productIds)

Parameters

settings ProductListViewModelSettings
Configuration of how the viewmodel should be created
productIds IList<string>
Ids of the products

Returns

ProductListViewModel
productListViewModel

CreateView(ProductListViewModelSettings, string)

Creates a viewmodel of a list of products.
public static ProductListViewModel CreateView(ProductListViewModelSettings settings, string groupId)

Parameters

settings ProductListViewModelSettings
Configuration of how the viewmodel should be created
groupId string
Id of the group containing the products

Returns

ProductListViewModel
productListViewModel

CreateView(ProductListViewModelSettings, string, IEnumerable<long>)

Creates a ViewModel of a list of products.
public static ProductListViewModel CreateView(ProductListViewModelSettings settings, string groupId, IEnumerable<long> productAutoIds)

Parameters

settings ProductListViewModelSettings
Configuration of how the ViewModel should be created.
groupId string
Id of group
productAutoIds IEnumerable<long>
Auto-ids of the products.

Returns

ProductListViewModel
The ProductListViewModel.

CreateView(ProductListViewModelSettings, string, string)

Creates a viewmodel of of the data that results from using the provided settings to do a index query search.
public static ProductListViewModel CreateView(ProductListViewModelSettings settings, string repositoryName, string queryName)

Parameters

settings ProductListViewModelSettings
Settings
repositoryName string
Name of repository
queryName string
Name of query

Returns

ProductListViewModel
The collection ofProductListViewModel

CreateView(ProductViewModel, IEnumerable<string>, bool)

public static List<FieldGroupViewModel> CreateView(ProductViewModel model, IEnumerable<string> groupSystemNames, bool hideZeroValues = false)

Parameters

model ProductViewModel
groupSystemNames IEnumerable<string>
hideZeroValues bool

Returns

List<FieldGroupViewModel>

CreateView(ProductViewModelSettings, IPriceInfo)

public static PriceViewModel CreateView(ProductViewModelSettings settings, IPriceInfo priceInfo)

Parameters

settings ProductViewModelSettings
priceInfo IPriceInfo

Returns

PriceViewModel

CreateView(ProductViewModelSettings, IEnumerable<ProductInfoViewModel>)

Creates a viewmodel of a list of related products.
public static IEnumerable<ProductViewModel> CreateView(ProductViewModelSettings settings, IEnumerable<ProductInfoViewModel> productInfo)

Parameters

settings ProductViewModelSettings
Configuration of how the viewmodel should be created
productInfo IEnumerable<ProductInfoViewModel>

Returns

IEnumerable<ProductViewModel>
The collection of ProductViewModel.

CreateView(ProductViewModelSettings, string)

Creates a viewmodel of a product.
public static ProductViewModel CreateView(ProductViewModelSettings settings, string productId)

Parameters

settings ProductViewModelSettings
Configuration of how the viewmodel should be created
productId string
Id of product

Returns

ProductViewModel
productViewModel

CreateView(ProductViewModelSettings, string, string)

Creates a viewmodel of a product.
public static ProductViewModel CreateView(ProductViewModelSettings settings, string productId, string variantId)

Parameters

settings ProductViewModelSettings
Configuration of how the viewmodel should be created
productId string
Id of product
variantId string
VariantId of product

Returns

ProductViewModel
productViewModel

CreateView(ProductViewModelSettings, string, string, string)

Creates a viewmodel of a product.
public static ProductViewModel CreateView(ProductViewModelSettings settings, string productId, string variantId, string groupId)

Parameters

settings ProductViewModelSettings
Configuration of how the viewmodel should be created
productId string
Id of product
variantId string
VariantId of product
groupId string

Returns

ProductViewModel
productViewModel
To top