EventingSubscriberServiceCollectionExtensions.TryAddEventingSubscriber<T> Method
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.
Attempts to add a singleton event subscriber of type T to the service collection.
public static void TryAddEventingSubscriber<T>(this Microsoft.Extensions.DependencyInjection.IServiceCollection services) where T : class, Aspire.Hosting.Lifecycle.IDistributedApplicationEventingSubscriber;
static member TryAddEventingSubscriber : Microsoft.Extensions.DependencyInjection.IServiceCollection -> unit (requires 'T : null and 'T :> Aspire.Hosting.Lifecycle.IDistributedApplicationEventingSubscriber)
<Extension()>
Public Sub TryAddEventingSubscriber(Of T As {Class, IDistributedApplicationEventingSubscriber}) (services As IServiceCollection)
Type Parameters
- T
A service that implements IDistributedApplicationEventingSubscriber
Parameters
- services
- IServiceCollection
The IServiceCollection to add the event subscriber to.