Register custom providers
To replace the system implementations of provider or helper classes with your custom ones, use assembly attributes:
Edit your provider class.
Add a using statement for the CMS namespace:
C#using CMS;
Register your custom providers by adding assembly attributes above the class declaration:
RegisterCustomProvider
RegisterCustomHelper
The parameter of each attribute must contain the exact type of the custom class extending the given object (obtained using the typeof
notation).
The customization automatically targets the provider object that matches the parent of the specified custom class.
// Registers custom providers
[assembly: RegisterCustomProvider(typeof(CustomUserInfoProvider))]
[assembly: RegisterCustomProvider(typeof(CustomMemberInfoProvider))]
The system now uses your customized providers instead of the default functionality.
Enabling class discovery
If your custom class is located in its own assembly (Class Library project), you need to make sure class discovery is enabled for the project. Otherwise, the RegisterCustom attributes cannot work. See Integrate custom code.