Custom Products module: Implement the OpenAccess data provider
After you create the base data provider class, you implement the OpenAccess provider that the Products module uses. The OpenAccess data provider must inherit and implement the abstract ProductsDataProvider class and the IOpenAccessDataProvider interface. To create an OpenAccess data provider:
- In the ProductsModule project, open the context menu of the Data folder » Implementation folder and click Add » Class.
- Name the class file OpenAccessProvider.cs and click Add.
- Make the OpenAccessProvider class inherit the ProductsDataProvider class and implement the IOpenAccessDataProvider interface.
- Implement the ProductsDataProvider abstract class.
- Implement the IOpenAccessDataProvider members.
The GetMetaDataSource method returns an instance of the ContentBaseMetadataSource implementation that defines the fluent mappings for your module.
- Mark the OpenAccessProvider class with the ContentProviderDecorator attribute.
- Implement the methods and the properties.
EXAMPLE: The following code sample exemplifies the above procedure: