DeclareModuleDependency Method
Declares a dependency on another CommerceModule, by type.
Namespace: Microsoft.CommerceServer.Runtime
Assembly: Microsoft.CommerceServer.Runtime (in Microsoft.CommerceServer.Runtime.dll)
Syntax
'Declaration
Protected Shared Sub DeclareModuleDependency ( _
moduleType As Type, _
dependentType As Type _
)
'Usage
Dim moduleType As Type
Dim dependentType As Type
CommerceModule.DeclareModuleDependency(moduleType, _
dependentType)
protected static void DeclareModuleDependency(
Type moduleType,
Type dependentType
)
protected:
static void DeclareModuleDependency(
Type^ moduleType,
Type^ dependentType
)
protected static function DeclareModuleDependency(
moduleType : Type,
dependentType : Type
)
Parameters
- moduleType
Type: System..::.Type
A System.Type that represents the type of module that the current module is dependent upon. Cannot be nullNothingnullptra null reference (Nothing in Visual Basic).
- dependentType
Type: System..::.Type
The Type of the dependent module.
Exceptions
Exception | Condition |
---|---|
CommerceResourceDependencyException | The resource that the module is dependent upon does not exist. |
ArgumentNullException | One of the required arguments was passed as a nullNothingnullptra null reference (Nothing in Visual Basic) value. |
Remarks
Some of the Microsoft Commerce Server classes have dependencies. When the module is created, the module runs checks to ensure that all dependencies are satisfied. If these dependencies are not satisfied an exception is generated. For Example, when the derived CommerceCacheModule creates the caches it also runs checks to make sure that the required module has been configured. If these dependences are not satisfied, a CommerceModuleDependencyException is generated.
Permissions
- Full trust for the immediate caller. This member cannot be used by partially trusted code. For more information, see Using Libraries from Partially Trusted Code.