Interface IServiceRepository
Provides access to imported services.
Namespace: Snowflake.Loader
Assembly: Snowflake.Framework.Primitives.dll
Syntax
public interface IServiceRepository
Properties
Services
Gets a list of available service types.
Declaration
IEnumerable<string> Services { get; }
Property Value
| Type | Description |
|---|---|
| System.Collections.Generic.IEnumerable<System.String> |
Methods
Get<T>()
Gets the given service
Declaration
T Get<T>()
where T : class
Returns
| Type | Description |
|---|---|
| T | The available services |
Type Parameters
| Name | Description |
|---|---|
| T | The requested service |
Exceptions
| Type | Condition |
|---|---|
| System.InvalidOperationException | The service has not been imported or you do not have permissions to access the service. |
ToServiceProvider()
Returns a System.IServiceProvider that includes the services available in this instance of IServiceRepository. The returned System.IServiceProvider has different usage semantics for System.IServiceProvider.GetService(System.Type) than Get<T>(), namely, getting a service that has not been authorized for this IServiceRepository, or one that does not exist, will return null instead of throwing System.InvalidOperationException.
Declaration
IServiceProvider ToServiceProvider()
Returns
| Type | Description |
|---|---|
| System.IServiceProvider | A System.IServiceProvider that contain all available services in this instance of IServiceRepository. |