Jobs module: Create the model
To create a custom content-based model:
In Visual Studio, in your project, open the context menu of the Model
folder and click Add » New Item...
- In the left pane, select Visual C# » Code.
- Click Class and in the Name input field, enter JobApplication.cs
- Open the file JobApplication.cs.
- Change the class definition.
- Override the SupportsContentLifecycle method.
- Define private fields for the properties.
- Define the job application properties.
EXAMPLE: For more information about the contents of the file, refer to class JobApplication.cs
from the downloaded sample project.
In this class, JobApplication is the name of your model. First, you mark your custom model as Persistent and specify the manager which is used to operate on this model. You implement the manager later on. By choosing Content as the parent class, your custom model automatically inherits a ready-to-use interface and functionality:
- IDynamicFieldsContainer
- ICommentable
- IExtensibleDataObject
- IOrganizable
- IVersionSerializable
- IInstanceCallbacks
- IContentLifecycle
- ILocalizable
Since content lifecycle is not required for this model, you explicitly disable content lifecycle by setting the SupportsContentLifecycle property to false.