Skip to content

Add ReferenceExpression to the External Parameters article #3221

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

Conversation

alistairmatthews
Copy link
Contributor

@alistairmatthews alistairmatthews commented May 1, 2025

Summary

Adds a new section describing how you can use reference expressions to manipulate connection strings in .NET Aspire 9.2 and later.

Fixes #2710


Internal previews

📄 File 🔗 Preview link
docs/fundamentals/external-parameters.md External parameters

@alistairmatthews
Copy link
Contributor Author

@IEvangelist can you check that I've done the code snippets correctly? They are in the snippets/referenceexpressions folder. Thanks!

Copy link
Member

@IEvangelist IEvangelist left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great, just want these ranges cleaned up. Try id if possible, will likely require a bit of refactoring in the Program.cs.

@alistairmatthews
Copy link
Contributor Author

Looks great, just want these ranges cleaned up. Try id if possible, will likely require a bit of refactoring in the Program.cs.

Done.

Question about IDs though: Do you know whether, if you put two blocks with the same ID in a code file, then referenced that ID in the triple-colon link, will it render both blocks? That would be useful. The guidance says you can nest them but nothing else.

@IEvangelist
Copy link
Member

That's a fair question, I'm not sure, but you could try it if you'd like. Here's how it renders now:

{00618717-665E-46D7-A3A6-5E7748DB7EA0}

@alistairmatthews
Copy link
Contributor Author

That's a fair question, I'm not sure, but you could try it if you'd like. Here's how it renders now:

{00618717-665E-46D7-A3A6-5E7748DB7EA0}

That looks good in the context of this article where we've had previous examples of complete app host program.cs files. I'll experiment with other examples though. Thanks!

@IEvangelist IEvangelist merged commit 982889c into dotnet:main May 2, 2025
7 checks passed
@alistairmatthews alistairmatthews deleted the add-reference-expressions-to-external-params-article branch May 8, 2025 13:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Enhance external parameters article with 9.2 AddConnectionString capabilities
2 participants