Interface IReadonlyDependencyResolver
- Namespace
- Splat
- Assembly
- Splat.Core.dll
An interface for interacting with a dependency resolver in a read-only fashion.
- Extension Methods
Methods
GetService(Type?)
Gets an instance of the given serviceType. Must return null
if the service is not available (must not throw).
Parameters
serviceTypeTypeThe object type.
Returns
- object
The requested object, if found;
nullotherwise.
GetService(Type?, string?)
Gets an instance of the given serviceType. Must return null
if the service is not available (must not throw).
Parameters
serviceTypeTypeThe object type.
contractstringA value which will retrieve only a object registered with the same contract.
Returns
- object
The requested object, if found;
nullotherwise.
GetService<T>()
Gets an instance of the given T. Must return null
if the service is not available (must not throw).
Returns
- T
The requested object, if found;
nullotherwise.
Type Parameters
TThe object type.
GetService<T>(string?)
Gets an instance of the given T. Must return null
if the service is not available (must not throw).
Parameters
contractstringA value which will retrieve only a object registered with the same contract.
Returns
- T
The requested object, if found;
nullotherwise.
Type Parameters
TThe object type.
GetServices(Type?)
Gets all instances of the given serviceType. Must return an empty
collection if the service is not available (must not return null or throw).
Parameters
serviceTypeTypeThe object type.
Returns
- IEnumerable<object>
A sequence of instances of the requested
serviceType. The sequence should be empty (notnull) if no objects of the given type are available.
GetServices(Type?, string?)
Gets all instances of the given serviceType. Must return an empty
collection if the service is not available (must not return null or throw).
Parameters
serviceTypeTypeThe object type.
contractstringA value which will retrieve only objects registered with the same contract.
Returns
- IEnumerable<object>
A sequence of instances of the requested
serviceType. The sequence should be empty (notnull) if no objects of the given type are available.
GetServices<T>()
Gets all instances of the given T. Must return an empty
collection if the service is not available (must not return null or throw).
Returns
- IEnumerable<T>
A sequence of instances of the requested
T. The sequence should be empty (notnull) if no objects of the given type are available.
Type Parameters
TThe object type.
GetServices<T>(string?)
Gets all instances of the given T. Must return an empty
collection if the service is not available (must not return null or throw).
Parameters
contractstringA value which will retrieve only objects registered with the same contract.
Returns
- IEnumerable<T>
A sequence of instances of the requested
T. The sequence should be empty (notnull) if no objects of the given type are available.
Type Parameters
TThe object type.