Skip to content
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

[New Article] Connect a .NET Aspire microservice to an external database #2787

Merged

Conversation

alistairmatthews
Copy link
Contributor

@alistairmatthews alistairmatthews commented Mar 11, 2025

Summary

Adds a new tutorial that illustrates how to work with an external database (i.e. those outside of .NET Aspire containers).

Partially addresses: #2336


Internal previews

📄 File 🔗 Preview link
docs/database/connect-to-existing-database.md Tutorial: Connect a .NET Aspire microservice to an existing database
docs/toc.yml docs/toc

@dotnetrepoman dotnetrepoman bot added the database Content related to database. label Mar 11, 2025
@davidfowl
Copy link
Member

Not external, but existing.

@alistairmatthews
Copy link
Contributor Author

Not external, but existing.

Thanks @davidfowl ~ all fixed.

@davidfowl
Copy link
Member

Is the idea that someone reads this and understands it works for all databases? I think the risk with this is that it is SQL server specific and doesn't teach people the pattern. We need to address that.

@alistairmatthews
Copy link
Contributor Author

Is the idea that someone reads this and understands it works for all databases? I think the risk with this is that it is SQL server specific and doesn't teach people the pattern. We need to address that.

Yes, that's right.

I've got the following note near the top. I could expand on it if you think it's not clear enough:

Tip

In this tutorial, you use EF Core with SQL Server. Other database integrations, including both those that use EF Core and others, can use the same approach to connect to an existing database.

Another approach would be to do a pivot for several different database integrations. That'll take longer though.

WDYT?

@IEvangelist IEvangelist merged commit bfa3c99 into dotnet:main Mar 27, 2025
7 checks passed
@alistairmatthews alistairmatthews deleted the new-tutorial-external-database branch March 28, 2025 14:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
community-contribution database Content related to database.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants