Interface IInjector
Provides the mechanism for injecting resources.
Inherited Members
Namespace: Solti.Utils.DI.Interfaces
Assembly: Solti.Utils.DI.Interfaces.dll
Syntax
public interface IInjector : IHasTag
Properties
Options
Describes the scope behavior.
Declaration
ScopeOptions Options { get; }
Property Value
Type | Description |
---|---|
ScopeOptions |
Methods
Get(Type, Object)
Gets the service instance associated with the given type and (optional) key.
Declaration
object Get(Type type, object key = null)
Parameters
Type | Name | Description |
---|---|---|
Type | type | The "id" of the service to be resolved. |
Object | key | The (optional) key of the service (usually a name). |
Returns
Type | Description |
---|---|
Object | The resolved service. |
Exceptions
Type | Condition |
---|---|
ServiceNotFoundException | The service or one or more dependencies could not be found. |
TryGet(Type, Object)
Tries to get the service instance associated with the given type and (optional) key.
Declaration
object TryGet(Type type, object key = null)
Parameters
Type | Name | Description |
---|---|---|
Type | type | The "id" of the service to be resolved. |
Object | key | The (optional) key of the service (usually a name). |
Returns
Type | Description |
---|---|
Object | The requested service instance or NULL. |