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
Returns
- CartViewModel
- CartViewModel.
CreateFieldColorValueView(string)
public static ColorViewModel CreateFieldColorValueView(string color)
Parameters
color
string
Returns
CreateFieldFileValueView(string)
public static FileViewModel CreateFieldFileValueView(string filePath)
Parameters
filePath
string
Returns
CreateFieldLinkValueView(string)
public static LinkViewModel CreateFieldLinkValueView(string url)
Parameters
url
string
Returns
CreateView(FavoriteListListViewModelSettings, IEnumerable<FavoriteList>)
public static FavoriteListListViewModel CreateView(FavoriteListListViewModelSettings settings, IEnumerable<FavoriteList> favoriteLists)
Parameters
settings
FavoriteListListViewModelSettingsfavoriteLists
IEnumerable<FavoriteList>
Returns
CreateView(FavoriteListViewModelSettings, FavoriteList)
public static FavoriteListViewModel CreateView(FavoriteListViewModelSettings settings, FavoriteList favoriteList)
Parameters
settings
FavoriteListViewModelSettingsfavoriteList
FavoriteList
Returns
CreateView(FavoriteProductListViewModelSettings, IEnumerable<FavoriteProduct>)
public static FavoriteProductListViewModel CreateView(FavoriteProductListViewModelSettings settings, IEnumerable<FavoriteProduct> favoriteProducts)
Parameters
settings
FavoriteProductListViewModelSettingsfavoriteProducts
IEnumerable<FavoriteProduct>
Returns
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
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
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
ProductViewModelgroupSystemNames
IEnumerable<string>hideZeroValues
bool
Returns
CreateView(ProductViewModelSettings, IPriceInfo)
public static PriceViewModel CreateView(ProductViewModelSettings settings, IPriceInfo priceInfo)
Parameters
settings
ProductViewModelSettingspriceInfo
IPriceInfo
Returns
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