AsyncServiceProviderInjection<TService,TInterface> Class
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
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. |