-
Notifications
You must be signed in to change notification settings - Fork 474
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allow WithArgs to accept ReferenceExpressions #4415
Conversation
@afscrome are you going to fix this PR? |
Hoping to pick this up over the weekend unless someone else wants to take it before then. Also spotted earlier today that a similar addition is probably warranted for |
There is a similar issue with aspire/src/Aspire.Hosting/ApplicationModel/ContainerRuntimeArgsCallbackAnnotation.cs Line 56 in a891b99
ContainerResourceBuilderExtensions.WithContainerRuntimeArgs only accepts a string array aspire/src/Aspire.Hosting/ContainerResourceBuilderExtensions.cs Lines 183 to 186 in a891b99
Shall I fix that as well? |
Any ideas on how to fix the ambiguity this change introduces between public static IResourceBuilder<ExecutableResource> AddExecutable(this IDistributedApplicationBuilder builder, string name, string command, string workingDirectory, params string[]? args)
public static IResourceBuilder<ExecutableResource> AddExecutable(this IDistributedApplicationBuilder builder, string name, string command, string workingDirectory, params object[]? args) I could remove the But equally if I remove the |
@afscrome - it looks like we were using an older SDK - 8.0.200. I updated to the latest .NET SDK 8.0.302 and the build error should be fixed now. You can overload methods on |
@eerhardt Can this be merged now? I've resolved the merge conflicts and checks are all passing. |
Can you add some tests for the new functionality? |
@afscrome Are you going to finish this one? |
object array params
Updated tests to cover the new scenarios. |
* Support providing `ReferenceExpression` arguments with `WithArgs()` * Update src/Aspire.Hosting/ExecutableResourceBuilderExtensions.cs * Update AddExecutableWithArgs test to include new varients allowign object array params --------- Co-authored-by: David Fowler <[email protected]>
Update the
WithArgs
extension method to acceptobject[]
rather thanstring[]
. In particular, this now allows for the use of reference expressions insideWithArgs
Fixes #4237
Microsoft Reviewers: Open in CodeFlow