IMPORTANT: This version of Sitefinity CMS is out of support and the respective product documentation is no longer maintained and can be outdated. Use the version selector to view a supported product version.
After you Custom Products module: Implement the data modelLocations module: Implement the data model of the Products module, you need to implement the view model class for the web service that calls the module.
Web services in Sitefinity CMS follow the MVVM pattern and therefore you must implement a view model class. To do so:
using
ProductCatalogSample.Model;
Telerik.Sitefinity.GenericContent.Model;
Telerik.Sitefinity.Modules;
Telerik.Sitefinity.Modules.GenericContent;
public
class
ProductItemViewModel : ContentViewModelBase
{
}
ProductItemViewModel()
:
base
()
ProductItemViewModel(ProductItem contentItem, ContentDataProviderBase provider)
(contentItem, provider)
this
.Price = contentItem.Price;
.QuantityInStock = contentItem.QuantityInStock;
.WhatIsInTheBox = contentItem.WhatIsInTheBox;
decimal
Price {
get
;
set
; }
int
QuantityInStock {
string
WhatIsInTheBox {
protected
override
Content GetLive()
return
.provider.GetLiveBase<ProductItem>((ProductItem)
.ContentItem);
Content GetTemp()
.provider.GetTempBase<ProductItem>((ProductItem)
Back To Top
To submit feedback, please update your cookie settings and allow the usage of Functional cookies.
Your feedback about this content is important