IReadonlyDependencyResolver interface¶
Defined in
Namespace: Splat
Assembly: Splat.Core.dll
Full name: Splat.IReadonlyDependencyResolver
Modifiers: public abstract
Summary¶
Defines a read-only contract for resolving service instances and collections by type and optional contract identifier.
Applies to
net10.0, net10.0-browserwasm1.0, net10.0-desktop1.0, net9.0, net9.0-browserwasm1.0, net9.0-desktop1.0, net8.0, net8.0-ios17.5, net8.0-maccatalyst17.5, net8.0-macos14.2, net8.0-macos14.5, net8.0-tvos17.2, netstandard2.1, net462, net481
Remarks¶
This interface provides methods to retrieve single or multiple service instances from a dependency resolver without allowing registration or modification of services. Implementations must not throw exceptions or return null when a service is unavailable; instead, they should return null for single-instance methods and an empty collection for multi-instance methods. This interface is typically used to access services in a decoupled manner, supporting scenarios such as dependency injection, plugin architectures, or service location patterns.
Methods¶
| Name | Summary |
|---|---|
| GetService | Gets an instance of the given serviceType. Must return null if the service is not available (must not throw). |
| GetServices | Gets all instances of the given serviceType. Must return an empty collection if the service is not available (must not return null or throw). |