Skip to content

Commit

Permalink
Patch 2 (#309)
Browse files Browse the repository at this point in the history
* Update sql-server-entity-framework-component.md

key used in the configuration description to match the example below.

* Update sql-server-entity-framework-component.md

fix description of key for multiple dbcontexts to match example also
  • Loading branch information
ZieMcd committed Jan 19, 2024
1 parent e4f53b2 commit b576c59
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions docs/database/sql-server-entity-framework-component.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ The .NET Aspire SQL Server Entity Framework Core component provides multiple con

### Use configuration providers

The .NET Aspire SQL Server Entity Framework Core component supports <xref:Microsoft.Extensions.Configuration?displayProperty=fullName>. It loads the <xref:Aspire.Microsoft.EntityFrameworkCore.SqlServer.MicrosoftEntityFrameworkCoreSqlServerSettings> from configuration files such as _appsettings.json_ by using the `Aspire:SqlServer:EntityFrameworkCore:SqlClient` key. If you have set up your configurations in the `Aspire:SqlServer:EntityFrameworkCore:SqlClient` section you can just call the method without passing any parameter.
The .NET Aspire SQL Server Entity Framework Core component supports <xref:Microsoft.Extensions.Configuration?displayProperty=fullName>. It loads the <xref:Aspire.Microsoft.EntityFrameworkCore.SqlServer.MicrosoftEntityFrameworkCoreSqlServerSettings> from configuration files such as _appsettings.json_ by using the `Aspire:Microsoft:EntityFrameworkCore:SqlServer` key. If you have set up your configurations in the `Aspire:Microsoft:EntityFrameworkCore:SqlServer` section you can just call the method without passing any parameter.

The following is an example of an _appsettings.json_ file that configures some of the available options:

Expand Down Expand Up @@ -97,7 +97,7 @@ builder.AddSqlServerDbContext<YourDbContext>(

### Configure multiple DbContext connections

If you want to register more than one `DbContext` with different configuration, you can use `$"Aspire.SqlServer.EntityFrameworkCore.SqlClient:{typeof(TContext).Name}"` configuration section name. The json configuration would look like:
If you want to register more than one `DbContext` with different configuration, you can use `$"Aspire.Microsoft.EntityFrameworkCore.SqlServer:{typeof(TContext).Name}"` configuration section name. The json configuration would look like:

```json
{
Expand Down

0 comments on commit b576c59

Please sign in to comment.