-
Couldn't load subscription status.
- Fork 712
Closed
Copy link
Labels
area-app-modelIssues pertaining to the APIs in Aspire.Hosting, e.g. DistributedApplicationIssues pertaining to the APIs in Aspire.Hosting, e.g. DistributedApplication
Milestone
Description
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.
9.1 has added the following method
public static IResourceBuilder<T> WithParentRelationship<T>(this IResourceBuilder<T> builder, IResource parent) where T : IResource
However using this when building resources is a bit clunky as you usually have
var db = builder.AddPostgres("db");
var migrator = builder
.AddExecutable("migrator", "migrator.exe", ".")
.WithParentRelationship(db.Resource);
Describe the solution you'd like
It would be nice if WithParentRelationship accepted the parent as an IResourceBuilder<IResource> rather than IResource. That would allow the above to simplify to:
var db = builder.AddPostgres("db");
var migrator = builder
.AddExecutable("migrator", "migrator.exe", ".")
- .WithParentRelationship(db.Resource);
+ .WithParentRelationship(db);Additional context
No response
Metadata
Metadata
Assignees
Labels
area-app-modelIssues pertaining to the APIs in Aspire.Hosting, e.g. DistributedApplicationIssues pertaining to the APIs in Aspire.Hosting, e.g. DistributedApplication