AsyncServiceProviderInjection<TService,TInterface> Class

Definition

Extenders using the VisualStudio.Extensibility model to develop in-process extension can use AsyncServiceProviderInjection<TService,TInterface> to retrieve services offered by the async service provider through .NET dependency injection.

public class AsyncServiceProviderInjection<TService,TInterface> where TInterface : class
type AsyncServiceProviderInjection<'Service, 'Interface (requires 'Interface : null)> = class
Public Class AsyncServiceProviderInjection(Of TService, TInterface)

Type Parameters

TService

The type that defines the service. TService is passed to GetServiceAsync(Type) when retrieving the service.

TInterface

The expected type of the retrieved service. The value returned by GetServiceAsync(Type) is cast to TInterface.

Inheritance
AsyncServiceProviderInjection<TService,TInterface>

Remarks

Extensions should retrieve instances of this type through dependency injection.

Constructors

AsyncServiceProviderInjection<TService,TInterface>(IAsyncServiceProvider2)

This constructor is for internal use only. Creates an instance of AsyncServiceProviderInjection<TService,TInterface>.

Methods

GetServiceAsync()

Asynchronously returns the retrieved service.

GetServiceAsync(Boolean)

Asynchronously returns the retrieved service.

Applies to