Skip to content

Add Fluent methods on IResourceBuilder<T> for subscribing to resource events #9168

@afscrome

Description

@afscrome

Is there an existing issue for this?

  • I have searched the existing issues

Is your feature request related to a problem? Please describe the problem.

When subscribing to events on a resource, you have to break out of the fluent builder pattern

var foo = builder.AddContainer();

builder.Eventing.Subscribe<BeforeResourceStartedEvent>(foo, (evt, ct) => { /*...*/ } );

return foo;

Describe the solution you'd like

It would be nice if we could have a fluent method to subscribe to resource events

return builder.AddContainer()
   .Subscribe<BeforeResourceStartedEvent>((evt, ct) => { /*...*/ } );

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    area-app-modelIssues pertaining to the APIs in Aspire.Hosting, e.g. DistributedApplication

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions