Class NinjectSettings
Contains configuration options for Ninject.
Inheritance
Inherited Members
Namespace: Telerik.JustMock.AutoMock.Ninject
Assembly: Telerik.JustMock.dll
Syntax
public class NinjectSettings : INinjectSettings
Constructors
NinjectSettings()
Declaration
public NinjectSettings()
Properties
ActivationCacheDisabled
Gets or sets a value indicating whether the activation cache is disabled. If the activation cache is disabled less memory is used. But in some cases instances are activated or deactivated multiple times. e.g. in the following scenario: Bind{A}().ToSelf(); Bind{IA}().ToMethod(ctx => kernel.Get{IA}();
Declaration
public bool ActivationCacheDisabled { get; set; }
Property Value
System.Boolean
|
Implements
AllowNullInjection
Gets or sets a value indicating whether Null is a valid value for injection. By default this is disabled and whenever a provider returns null an exception is thrown.
Declaration
public bool AllowNullInjection { get; set; }
Property Value
System.Boolean
|
Implements
CachePruningInterval
Gets or sets the interval at which the GC should be polled.
Declaration
public TimeSpan CachePruningInterval { get; set; }
Property Value
System.TimeSpan
|
Implements
DefaultScopeCallback
Gets or sets the default scope callback.
Declaration
public Func<IContext, object> DefaultScopeCallback { get; set; }
Property Value
System.Func<IContext, System.Object>
|
Implements
ExtensionSearchPatterns
Gets or sets the paths that should be searched for extensions.
Declaration
public string[] ExtensionSearchPatterns { get; set; }
Property Value
System.String[]
|
Implements
InjectAttribute
Gets or sets the attribute that indicates that a member should be injected.
Declaration
public Type InjectAttribute { get; set; }
Property Value
System.Type
|
Implements
InjectNonPublic
Gets or sets a value indicating whether Ninject should inject non public members.
Declaration
public bool InjectNonPublic { get; set; }
Property Value
System.Boolean
|
Implements
InjectParentPrivateProperties
Gets or sets a value indicating whether Ninject should inject private properties of base classes.
Declaration
public bool InjectParentPrivateProperties { get; set; }
Property Value
System.Boolean
|
Implements
Remarks
Activating this setting has an impact on the performance. It is recommended not to use this feature and use constructor injection instead.
LoadExtensions
Gets or sets a value indicating whether the kernel should automatically load extensions at startup.
Declaration
public bool LoadExtensions { get; set; }
Property Value
System.Boolean
|
Implements
ThrowOnGetServiceNotFound
Gets or sets a value indicating whether the old (<= 3.3.4) behavior of System.IServiceProvider.GetService(System.Type) should be used which throws an exception if the requested service cannot be found. Note that the documentation of that method https://docs.microsoft.com/en-us/dotnet/api/system.iserviceprovider.getservice?view=netframework-4.6.2 states that the method should return null if there is no such service.
Declaration
public bool ThrowOnGetServiceNotFound { get; set; }
Property Value
System.Boolean
|
Implements
UseReflectionBasedInjection
Gets or sets a value indicating whether Ninject should use reflection-based injection instead of the (usually faster) lightweight code generation system.
Declaration
public bool UseReflectionBasedInjection { get; set; }
Property Value
System.Boolean
|
Implements
Methods
Get<T>(String, T)
Gets the value for the specified key.
Declaration
public T Get<T>(string key, T defaultValue)
Parameters
System.String
key
The setting's key. |
T
defaultValue
The value to return if no setting is available. |
Returns
T
The value, or the default value if none was found. |
Type Parameters
T
The type of value to return. |
Implements
Set(String, Object)
Sets the value for the specified key.
Declaration
public void Set(string key, object value)
Parameters
System.String
key
The setting's key. |
System.Object
value
The setting's value. |