Skip to content
DocsTry Aspire
DocsTry

InitializeResourceEvent Constructors

ClassConstructors1 member
This event is raised by orchestrators to signal to resources that they should initialize themselves.
Constructor(IResource, IDistributedApplicationEventing, ResourceLoggerService, ResourceNotificationService, IServiceProvider)Section titled Constructor(IResource, IDistributedApplicationEventing, ResourceLoggerService, ResourceNotificationService, IServiceProvider)
This event is raised by orchestrators to signal to resources that they should initialize themselves.
public class InitializeResourceEvent
{
public InitializeResourceEvent(
IResource resource,
IDistributedApplicationEventing distributedApplicationEventing,
ResourceLoggerService resourceLoggerService,
ResourceNotificationService resourceNotificationService,
IServiceProvider services)
{
// ...
}
}
resourceIResourceThe resource that is being created.
distributedApplicationEventingIDistributedApplicationEventingThe IDistributedApplicationEventing service for the AppHost.
resourceLoggerServiceResourceLoggerServiceThe ResourceLoggerService for the AppHost.
resourceNotificationServiceResourceNotificationServiceThe ResourceNotificationService for the AppHost.
servicesIServiceProviderThe IServiceProvider for the AppHost.
Custom resources can subscribe to this event to perform initialization tasks, including starting background tasks that manage the resource's lifecycle.