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 view model class of the Products module web service, you need to create the backend service:
using
ProductCatalogSample.Data;
ProductCatalogSample.Model;
ProductCatalogSample.Web.Services.Data;
Telerik.Sitefinity.Modules;
Telerik.Sitefinity.Modules.GenericContent;
Telerik.Sitefinity.Lifecycle;
public
class
ProductsBackendService : ContentServiceBase<ProductItem, ProductItemViewModel, LifecycleDecoratorWrapper<ProductItem, ProductsManager, ProductsDataProvider>>
{
}
override
IQueryable<ProductItem> GetChildContentItems(Guid parentId,
string
providerName)
throw
new
NotSupportedException();
ProductItem GetContentItem(Guid id,
return
ProductsManager.GetManager(providerName).GetProduct(id);
IQueryable<ProductItem> GetContentItems(
ProductsManager.GetManager(providerName).GetProducts();
ProductItem GetParentContentItem(Guid id,
IEnumerable<ProductItemViewModel> GetViewModelList(IEnumerable<ProductItem> contentList, ContentDataProviderBase dataProvider)
var viewModelList =
List<ProductItemViewModel>();
foreach
(var product
in
contentList)
viewModelList.Add(
ProductItemViewModel(product, dataProvider));
viewModelList;
LifecycleDecoratorWrapper<ProductItem, ProductsManager, ProductsDataProvider> GetManager(
LifecycleDecoratorWrapper<ProductItem, ProductsManager, ProductsDataProvider>(providerName);
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