microsoft / microsoft/aspire

Expose an `OnClientReady` method on resources for interacting with the service

Open
#12,744 0 comments 1 reaction 0 assignees View on GitHub
needs-area-label
Dominant language
C#
Stars
6.3k
Forks
991
Avg merge
2d 15h
Merged PRs (30d)
196

Description

### Is there an existing issue for this?

- [x] I have searched the existing issues

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

following up on https://github.com/dotnet/aspire/issues/11904

Seeding data into resources doesn't have a built-in pattern today, you would need to do something like this
https://github.com/dotnet/aspire/blob/ba652c4e3b1e0ee27fd4de7ae2dd94491206de56/playground/mongo/Mongo.AppHost/Program.cs#L13-L31 which contains some repetitive logic in it

### Describe the solution you'd like

A convention of adding a `OnClientReady` method, it's event object will contain a client object from the resource's client SDK.

### Additional context

I have a demo here https://github.com/Meir017/aspirations-for-aspire/tree/main/ResourceClientReady

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.