Class NinjectDependencyResolver
Provides an ability to resolve instances of objects using Ninject
Namespace: Cqrs.Ninject.Configuration
Assembly: Cqrs.Ninject.dll
Syntax
public class NinjectDependencyResolver : DependencyResolver, IDependencyResolver
Constructors
NinjectDependencyResolver(IKernel)
Instantiates a new instance of NinjectDependencyResolver
Declaration
public NinjectDependencyResolver(IKernel kernel)
Parameters
Type | Name | Description |
---|---|---|
IKernel | kernel |
Fields
ModulesToLoad
A collection of
Declaration
public static IList<INinjectModule> ModulesToLoad
Field Value
Type | Description |
---|---|
IList<INinjectModule> |
Properties
DependencyResolverCreator
A user supplied
Declaration
public static Func<IKernel, NinjectDependencyResolver> DependencyResolverCreator { get; set; }
Property Value
Type | Description |
---|---|
Func<IKernel, NinjectDependencyResolver> |
Kernel
The inner Ninject
Declaration
public IKernel Kernel { get; }
Property Value
Type | Description |
---|---|
IKernel |
Methods
BindDependencyResolver()
Checks if IDependencyResolver has already been registered and if not, registers this instance to it.
Declaration
protected virtual void BindDependencyResolver()
PrepareKernel(IKernel)
Calls
Declaration
public static void PrepareKernel(IKernel kernel)
Parameters
Type | Name | Description |
---|---|---|
IKernel | kernel | The |
Resolve(Type)
Resolves a single instance for the specified type
.
by calling
Declaration
public override object Resolve(Type type)
Parameters
Type | Name | Description |
---|---|---|
Type | type |
Returns
Type | Description |
---|---|
System.Object |
Resolve<T>()
Resolves a single instance for the specified T
.
by calling
Declaration
public override T Resolve<T>()
Returns
Type | Description |
---|---|
T |
Type Parameters
Name | Description |
---|---|
T |
Overrides
Start(IKernel, Boolean)
Starts the NinjectDependencyResolver
Declaration
public static void Start(IKernel kernel = null, bool prepareProvidedKernel = false)
Parameters
Type | Name | Description |
---|---|---|
IKernel | kernel | |
System.Boolean | prepareProvidedKernel |
Remarks
this exists to the static constructor can be triggered.