For developers: Create custom modules
Integrate the OpenAccess enhancer
To integrate the OpenAccess enhancer you must perform the following:
- From the context menu of the module's project, click Unload Project.
- From the context menu of the unloaded project, click Edit ModuleName.csproj.
- Perform the following:
NOTE: Take note at the following things:
- The path to the
VEnhance.exe
The VEnhance.exe
is shipped with the Sitefinity CMS SDK. It can be found in the installation directory of the Sitefinity CMS 4.0 SDK under \Libraries
. Before reusing the code snippet, ensure that your Venhance.exe
file is placed in C:\Program Files (x86)\Telerik\Sitefinity CMS 4.0\Libraries\VEnhance.exe
-
The path to the
App.config
file in your module's project.
The code snippet assumes that the file is placed in the root of your project and the path to it is defined as $(ProjectDir)App.config
.
Create the App.config file
The App.config
file contains information about the OpenAccess configuration and the mappings it creates for the model class.
To create and implement the App.config file, perform the following:
- From the context menu of the module's project, click Add » New Item.
- From the dialog click Visual C# Items » Data » XML File.
- Name the file
App.config
and click Add.
- Open the App.config file.
- In it create the following sections:
Create the OpenAccess mappings
The OpenAccess mappings are defined in the App.config file. To define the mappings, perform the following:
- Open the App.config file.
- Find the mappings section.
- In it define the mappings for the model classes in your module.
Following is the code for a class named ProductItem: