Click or drag to resize
ObjectTypeManagerRegisterObjectType Method
Registers the object type

Namespace: CMS.DataEngine
Assembly: CMS.DataEngine (in CMS.DataEngine.dll) Version: 13.0.131
Syntax
C#
public static void RegisterObjectType(
	string objectType,
	ObjectTypeInfo typeInfo,
	Type type,
	bool allowObjectTypeProviderRegistration = true
)

Parameters

objectType
Type: SystemString
Object type to be registered.
typeInfo
Type: CMS.DataEngineObjectTypeInfo
TypeInfo configuration of the registered object type.
type
Type: SystemType
Type to be registered.
allowObjectTypeProviderRegistration (Optional)
Type: SystemBoolean
Indicates whether registration of a corresponding object type info provider into IoC container can be performed.
Exceptions
ExceptionCondition
ArgumentExceptionThrown when object type is either null or empty.
ArgumentNullExceptionThrown when either type info or type is null.
Remarks

The method registers a corresponding IInfoProviderTInfo implementation into IoC container if typeInfo specifies the ProviderType to be registered and allowObjectTypeProviderRegistration is not false.

All object types must be registered during application pre-initialization. Registration into the IoC container cannot be performed after the container's initialization has finished.

Use the allowObjectTypeProviderRegistration parameter in scenarios when the IoC container is not available (i.e. unit tests). In such scenarios, the allowObjectTypeProviderRegistration must be false.

See Also