Skip to content

Document EF Core AppHost migration management#1175

Open
IEvangelist with Copilot wants to merge 3 commits into
mainfrom
copilot/133-document-aspire-hosting-entityframeworkcore
Open

Document EF Core AppHost migration management#1175
IEvangelist with Copilot wants to merge 3 commits into
mainfrom
copilot/133-document-aspire-hosting-entityframeworkcore

Conversation

Copilot AI commented Jun 2, 2026

Copy link
Copy Markdown
Contributor

Adds the 13.3 docs page for Aspire.Hosting.EntityFrameworkCore and wires it into the EF Core docs set. This documents the AppHost-side EF migration model separately from the existing per-database EF Core client integration pages.

  • New EF Core AppHost page

    • Added integrations/databases/efcore/efcore-host.mdx
    • Documents the AppHost-only role of Aspire.Hosting.EntityFrameworkCore
    • Covers:
      • AddEFMigrations usage
      • startup migration orchestration with RunDatabaseUpdateOnStart
      • ordering dependent apps with WaitForCompletion
      • migration resource configuration (WithMigrationsProject, output directory, namespace)
      • dashboard operations surfaced for EFMigrationResource
  • TypeScript parity

    • Included both C# and TypeScript AppHost samples because the package surface exists in the repo’s exported TS metadata
    • Kept examples aligned with the actual exported API shape
  • EF Core overview updates

    • Added a direct pointer from efcore/overview.mdx to the new AppHost page
    • Clarifies the distinction between:
      • EF Core client integrations in consuming apps
      • EF migration management modeled in the AppHost
  • Navigation and localization

    • Added the new page to the EF Core sidebar section
    • Added the ja mirror page with English placeholder content to match the repo’s localization flow

Example AppHost usage:

var api = builder.AddProject<Projects.Api>("api")
    .WithReference(db);

var migrations = api.AddEFMigrations("api-migrations", "MyApp.Data.AppDbContext")
    .RunDatabaseUpdateOnStart();

api.WaitForCompletion(migrations);

Copilot AI and others added 2 commits June 2, 2026 03:56
Co-authored-by: IEvangelist <7679720+IEvangelist@users.noreply.github.com>
Co-authored-by: IEvangelist <7679720+IEvangelist@users.noreply.github.com>
Copilot AI changed the title [WIP] Document Aspire.Hosting.EntityFrameworkCore Document EF Core AppHost migration management Jun 2, 2026
Copilot AI requested a review from IEvangelist June 2, 2026 04:11
title: Set up EF Core migration management in the AppHost
description: Learn how to use Aspire.Hosting.EntityFrameworkCore to model EF Core migrations, dashboard commands, and startup or publish workflows from your AppHost.
---

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Also mention that the connection string shouldn't be configured during publish, see microsoft/aspire#17847 (comment)

@AndriySvyryd

Copy link
Copy Markdown
Member

@IEvangelist I can review this once you decide on the general structure for these docs

@IEvangelist IEvangelist marked this pull request as ready for review June 30, 2026 08:38
@IEvangelist IEvangelist requested a review from eerhardt as a code owner June 30, 2026 08:38
Copilot AI review requested due to automatic review settings June 30, 2026 08:38

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

This PR adds a new EF Core documentation page focused on AppHost-side EF Core migration management via Aspire.Hosting.EntityFrameworkCore, and connects it into the EF Core docs and sidebar navigation. It also introduces a Japanese locale mirror page (currently English placeholder content) consistent with the repo’s localization workflow.

Changes:

  • Added a new efcore-host page documenting AppHost modeling of EF migrations, including dashboard operations and startup/publish workflows (C# + TypeScript samples).
  • Updated the EF Core overview to link to the new AppHost migration-management page and clarify AppHost vs consuming-app responsibilities.
  • Wired the new page into the Integrations sidebar EF Core section; added a ja mirror page.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.

File Description
src/frontend/src/content/docs/ja/integrations/databases/efcore/efcore-host.mdx Adds the Japanese-locale mirror page (English placeholder) for the new EF Core AppHost migration management doc.
src/frontend/src/content/docs/integrations/databases/efcore/overview.mdx Adds a pointer to the new AppHost migration-management page and improves formatting/clarity.
src/frontend/src/content/docs/integrations/databases/efcore/efcore-host.mdx Adds the new EF Core AppHost migration management documentation page (C# + TypeScript).
src/frontend/config/sidebar/integrations.topics.ts Adds the new EF Core AppHost page to the EF Core sidebar navigation.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

data-zoom-off
/>

This article is the AppHost reference for [`Aspire.Hosting.EntityFrameworkCore`](https://www.nuget.org/packages/Aspire.Hosting.EntityFrameworkCore). Unlike the existing EF Core database pages, which focus on registering a `DbContext` inside a consuming .NET app, this package lives in the [`AppHost`](/get-started/app-host/) and models EF Core migration management for a project resource. It doesn't provision a database or replace the per-database EF Core client packages — instead, it adds a provider-agnostic EF Core migration resource that you can orchestrate alongside your existing database and app resources.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[13.3] Document Aspire.Hosting.EntityFrameworkCore

4 participants