Interface IScopedServiceProvider<TService>

Namespace
Datamine.MineTrustConnector.Service.Extensibility.Abstractions
Assembly
Datamine.MineTrustConnector.Service.Extensibility.dll

Abstraction over a 'scoped' service provider in MineTrust Connector. Services in MineTrust Connector may be scoped to a particular MineTrustConnection, ensuring that dedicated services are created for each scope.

public interface IScopedServiceProvider<TService> where TService : notnull

Type Parameters

TService

The type of the service.

Methods

GetScopedServiceFor(MineTrustConnection)

Gets an instance of the service which is scoped to the specified MineTrustConnection. Service instances are guaranteed to be unique per server connection.

TService GetScopedServiceFor(MineTrustConnection connection)

Parameters

connection MineTrustConnection

The connection.

Returns

TService

The scoped service

TryGetService(MineTrustConnection, out TService)

Tries to access the service which was created for the specified scope, returning a value indicating whether or not such a service was found.

bool TryGetService(MineTrustConnection connection, out TService service)

Parameters

connection MineTrustConnection

The connection.

service TService

The service.

Returns

bool

True if a service was registered, otherwise false.

TryRemoveService(MineTrustConnection, out TService)

Tries to remove the specified scoped service from this instance, returning a value indicating whether or not such a service was found.

bool TryRemoveService(MineTrustConnection connection, out TService service)

Parameters

connection MineTrustConnection

The connection.

service TService

The service.

Returns

bool

True if a service was registered, otherwise false.