Jobs module: Define the abstract data provider
An abstract data provider class defines required methods. To operate with the custom data model, inheritors must implement these methods.
To create an abstract data provider class for your JobApplication model, perform the following:
- In Visual Studio, open the context menu of the project and click Add » New Item...
- In the left pane, select Visual C# » Code.
- Click Class and in the Name input field, enter JobsDataProviderBase.cs
- Open the file JobsDataProviderBase.cs.
- Change the class definition to inherit
ContentDataProviderBase
.
- Define the root key.
- Define the abstract data provider methods.
- Implement ContentDataProviderBase.
EXAMPLE: For more information about the contents of the file, refer to class JobsDataProviderBase.cs
from the downloaded sample project.
In this file, you first make the class inherit from ContentDataProviderBase - the default provider base class for content-based models. Then, you specify the methods required to perform CRUD operations on your JobApplications model. The methods CreateItem, GetItem, GetItems, and DeleteItem are required for the CRUD operations. The method GetKnownTypes() returns the model types that the provider can operate on - in this case the JobApplication model.