Overview of Entity Framework Core integrations in Aspire
mainAspire provides EF Core client integrations for popular relational and document databases. These integrations simplify the process of using EF Core in cloud-native microservices by automating several key tasks in your service's Program.cs:
- Pooled
DbContextregistration: Automatically registers a context pool usingAdd<DatabaseSystem>DbContextto reduce per-request allocation overhead. - Observability: Enables health checks, OpenTelemetry distributed tracing, and connection-retry resiliency out of the box.
- Centralized Connection Management: Database resources are declared in the
AppHostand forwarded as named references to consuming services.
Note: EF Core is a client integration. It runs inside your .NET microservices. The AppHost uses separate hosting integrations to manage the actual database containers or cloud resources.