This is a very concise description. However, look at it in conjunction with the App Host project configuration of the database:
var builder = DistributedApplication.CreateBuilder(args);
var sql = builder.AddSqlServer("sql")
.WithLifetime(ContainerLifetime.Persistent);
var db = sql.AddDatabase("database");
builder.AddProject<Projects.ExampleProject>()
.WithReference(db);
// After adding all resources, run the app...
In this example, "database" and "sqldb" could be named the same thing to convey the fact that how the hosting integration names the database must match how the client integration names the database as well.
var builder = DistributedApplication.CreateBuilder(args);
var sql = builder.AddSqlServer("sqlserver")
.WithLifetime(ContainerLifetime.Persistent);
var db = sql.AddDatabase("sqldb");
builder.AddProject<Projects.ExampleProject>()
.WithReference(db);
// After adding all resources, run the app...
Type of issue
Other (describe below)
Description
In the
Example Usage
section of the EF Core page, the integration-consuming project gets an example:This is a very concise description. However, look at it in conjunction with the App Host project configuration of the database:
In this example,
"database"
and"sqldb"
could be named the same thing to convey the fact that how the hosting integration names the database must match how the client integration names the database as well.This point is covered well in this community video by Codewrinkles
My recommendation is:
Page URL
https://learn.microsoft.com/en-us/dotnet/aspire/database/sql-server-entity-framework-integration?tabs=dotnet-cli%2Cssms
Content source URL
https://github.com/dotnet/docs-aspire/blob/main/docs/database/sql-server-entity-framework-integration.md
Document Version Independent Id
bf3e4e4b-039e-29fa-f9f0-3512be634ca8
Article author
@CamSoper