Class IInjectorAdvancedExtensions
Defines some advanced extensions on the IInjector interface.
Inheritance
Namespace: Solti.Utils.DI
Assembly: Solti.Utils.DI.dll
Syntax
public static class IInjectorAdvancedExtensions : Object
Methods
AssignScopeLocal(IInjector, Type, Object)
Assigns a scope-local variable. Scope-locals are instances (for example the HTTP request object) provided by the current session.
Declaration
public static void AssignScopeLocal(this IInjector self, Type type, object value)
Parameters
Type | Name | Description |
---|---|---|
IInjector | self | The target IServiceCollection. |
System.Type | type | The service type to be registered. It can not be null and can be registered only once. |
System.Object | value | The value to be assigned. It cannot be null. |
Remarks
The value
won't be disposed by the system.
AssignScopeLocal(IInjector, Type, Object, Object)
Assigns a scope-local variable. Scope-locals are instances (for example the HTTP request object) provided by the current session.
Declaration
public static void AssignScopeLocal(this IInjector self, Type type, object key, object value)
Parameters
Type | Name | Description |
---|---|---|
IInjector | self | The target IServiceCollection. |
System.Type | type | The service type to be registered. It can not be null and can be registered only once (with the given |
System.Object | key | The (optional) service key (usually a name). |
System.Object | value | The value to be assigned. It cannot be null. |
Remarks
The value
won't be disposed by the system.
AssignScopeLocal<TType>(IInjector, TType)
Assigns a scope-local variable. Scope-locals are instances (for example the HTTP request object) provided by the current session.
Declaration
public static void AssignScopeLocal<TType>(this IInjector self, TType value)
Parameters
Type | Name | Description |
---|---|---|
IInjector | self | The target IServiceCollection. |
TType | value | The value to be assigned. It cannot be null. |
Type Parameters
Name | Description |
---|---|
TType |
Remarks
The value
won't be disposed by the system.
AssignScopeLocal<TType>(IInjector, Object, TType)
Assigns a scope-local variable. Scope-locals are instances (for example the HTTP request object) provided by the current session.
Declaration
public static void AssignScopeLocal<TType>(this IInjector self, object key, TType value)
Parameters
Type | Name | Description |
---|---|---|
IInjector | self | The target IServiceCollection. |
System.Object | key | The (optional) service key (usually a name). |
TType | value | The value to be assigned. It cannot be null. |
Type Parameters
Name | Description |
---|---|
TType |
Remarks
The value
won't be disposed by the system.