Extend Sitefinity CMS data model: Create the custom type class
After you reference the required assemblies, you implement the custom type class. The custom type class is used to persist the information to the database. Such classes are also called model classes. Depending on the design, you can create more than one model class.
To be more consistent with Sitefinity's architecture, the CustomType class implements the IDataItem interface. Inside the CustomTypesclass you add the properties that are persisted to the database.
- In Visual Studio, open the context menu of the project and click Add » Class.
- Name the class file CustomType.cs
- Make the CustomType class implement the IDataItem interface.
- Define the ApplicationName, Id, LastModified, Provider, and Transaction properties from the IDataItem interface.
- Define any additional properties that you want to persist to to database.
- Create a constructor that sets the values for the ApplicationName and Id.
Use the following code sample: