Interface INinjectSettings
Contains configuration options for Ninject.
Namespace: Telerik.JustMock.AutoMock.Ninject
Assembly: Telerik.JustMock.dll
Syntax
public interface INinjectSettings
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
bool ActivationCacheDisabled { get; set; }
Property Value
System.Boolean
|
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
bool AllowNullInjection { get; set; }
Property Value
System.Boolean
|
CachePruningInterval
Gets the interval at which the cache should be pruned.
Declaration
TimeSpan CachePruningInterval { get; }
Property Value
System.TimeSpan
|
DefaultScopeCallback
Gets the default scope callback.
Declaration
Func<IContext, object> DefaultScopeCallback { get; }
Property Value
System.Func<IContext, System.Object>
|
ExtensionSearchPatterns
Gets the paths that should be searched for extensions.
Declaration
string[] ExtensionSearchPatterns { get; }
Property Value
System.String[]
|
InjectAttribute
Gets the attribute that indicates that a member should be injected.
Declaration
Type InjectAttribute { get; }
Property Value
System.Type
|
InjectNonPublic
Gets or sets a value indicating whether Ninject should inject non public members.
Declaration
bool InjectNonPublic { get; set; }
Property Value
System.Boolean
|
InjectParentPrivateProperties
Gets or sets a value indicating whether Ninject should inject private properties of base classes.
Declaration
bool InjectParentPrivateProperties { get; set; }
Property Value
System.Boolean
|
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 a value indicating whether the kernel should automatically load extensions at startup.
Declaration
bool LoadExtensions { get; }
Property Value
System.Boolean
|
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
bool ThrowOnGetServiceNotFound { get; set; }
Property Value
System.Boolean
|
UseReflectionBasedInjection
Gets a value indicating whether Ninject should use reflection-based injection instead of the (usually faster) lightweight code generation system.
Declaration
bool UseReflectionBasedInjection { get; }
Property Value
System.Boolean
|
Methods
Get<T>(String, T)
Gets the value for the specified key.
Declaration
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. |
Set(String, Object)
Sets the value for the specified key.
Declaration
void Set(string key, object value)
Parameters
System.String
key
The setting's key. |
System.Object
value
The setting's value. |