Skip to content

Commit 01a87ca

Browse files
committed
Line edits2
1 parent ac98fb5 commit 01a87ca

File tree

4 files changed

+24
-24
lines changed

4 files changed

+24
-24
lines changed

learn-pr/aspnetcore/use-databases-dotnet-aspire-app/includes/exercise-use-databases-persist-data-from-aspire-app.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ Install the .NET Aspire workload using the .NET CLI:
5353
You should see the details of the .NET Aspire workload.
5454
5555
```console
56-
Installed Workload Id Manifest Version Installation Source
56+
Installed Workload Id Manifest Version Installation Source
5757
---------------------------------------------------------------------------------------------
5858
aspire 8.0.0/8.0.100 SDK 8.0.300-preview.24203, VS 17.10.34902.84
5959

learn-pr/aspnetcore/use-databases-dotnet-aspire-app/includes/store-data-sql-databases.md

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ In the app host project:
2020

2121
- Install the .NET Aspire hosting integration to the app host project.
2222
- Register a database and create a container for it in the solution's app host.
23-
- Pass a reference to the projects that needs access to the created container hosting the database.
23+
- Pass a reference to the projects that need access to the created container hosting the database.
2424

2525
In the projects that use the database:
2626

@@ -114,12 +114,12 @@ Once the database is registered in the consuming project, you can interact with
114114
public class YourService(NpgsqlDataSource dataSource)
115115
{
116116
public async Task<IEnumerable<Catalog>> GetCatalog()
117-
{
117+
{
118118
const string query = "SELECT * FROM catalog";
119119
using var dbConnection = dataSource.OpenConnection();
120120
var results = await dbConnection.QueryAsync<Catalog>(command);
121121
return queryResult.ToArray();
122-
}
122+
}
123123
}
124124
```
125125

@@ -129,17 +129,17 @@ Or you can then retrieve the database context `YourDbContext` to interact with t
129129
public class YourService(YourDbContext context)
130130
{
131131
public async Task<IEnumerable<Catalog>> GetCatalog()
132-
{
132+
{
133133
var items = await context.ObjectItems;
134134
if (item is null)
135135
{
136136
return Results.NotFound();
137137
}
138-
else
139-
{
140-
return items;
141-
}
142-
}
138+
else
139+
{
140+
return items;
141+
}
142+
}
143143
}
144144
```
145145

@@ -171,7 +171,7 @@ Then in the configuration file, you can add the connection string:
171171

172172
### Using configuration providers
173173

174-
.NET Aspire has a feature of integrations that allows them to support a `Microsoft.Extensions.Configuration`. The PostgreSQL integration supports this feature, and by default it looks for settings using the `Aspire:Npgsql` key. In projects using *appsettings.json*, an example configuration might look like this:
174+
.NET Aspire has a feature of integrations that allows them to support a `Microsoft.Extensions.Configuration`. The PostgreSQL integration supports this feature, and by default it looks for settings using the `Aspire:Npgsql` key. In projects using _appsettings.json_, an example configuration might look like this:
175175

176176
```json
177177
{
@@ -186,7 +186,7 @@ Then in the configuration file, you can add the connection string:
186186
}
187187
```
188188

189-
The previous configuration is setting the connection string, enabling health checks, tracing, and metrics for the PostgreSQL integration. You code then no longer needs to specify the connection string, just use `builder.AddNpgsqlDataSource();`.
189+
The previous configuration is setting the connection string, enabling health checks, tracing, and metrics for the PostgreSQL integration. Your code then no longer needs to specify the connection string, just use `builder.AddNpgsqlDataSource();`.
190190

191191
If you're using the PostgreSQL Entity Framework Core integration, you can use the `Aspire:Npgsql:EntityFrameworkCore:PostgreSQL` key to configure the database context:
192192

@@ -296,7 +296,7 @@ As before, if you use the same database name in app host and the consuming proje
296296

297297
### Using configuration providers
298298

299-
The SQL Server integration also supports `Microsoft.Extensions.Configuration`. By default, it looks for settings using the `Aspire:SqlServer:SqlClient` key. In projects using *appsettings.json*, an example configuration might look like this:
299+
The SQL Server integration also supports `Microsoft.Extensions.Configuration`. By default, it looks for settings using the `Aspire:SqlServer:SqlClient` key. In projects using _appsettings.json_, an example configuration might look like this:
300300

301301
```json
302302
{
@@ -323,10 +323,10 @@ builder.AddSqlServerClient("sqldata", static settings => settings.HealthChecks =
323323

324324
You can pass any of the supported options:
325325

326-
* `ConnectionString`: The connection string of the SQL Server database
327-
* `HealthChecks`: A boolean value that indicates whether the database health check is enabled
328-
* `Tracing`: A boolean value that indicates whether the OpenTelemetry tracing is enabled
329-
* `Metrics`: A boolean value that indicates whether the OpenTelemetry metrics are enabled
326+
- `ConnectionString`: The connection string of the SQL Server database.
327+
- `HealthChecks`: A boolean value that indicates whether the database health check is enabled.
328+
- `Tracing`: A boolean value that indicates whether the OpenTelemetry tracing is enabled.
329+
- `Metrics`: A boolean value that indicates whether the OpenTelemetry metrics are enabled.
330330

331331
### Connect to multiple databases
332332

@@ -380,7 +380,7 @@ var myService = builder.AddProject<Projects.MyService>()
380380
```
381381

382382
Like the PostgreSQL integration, the MySQL integration also allows you to create a container for database management tools. The previous example adds **PhpMyAdmin** to the solution.
383-
383+
384384
## Using a MySQL database
385385

386386
The pattern is the same in the projects that need MySQL access. In the _Program.cs_ file, this code registers the database:
@@ -429,7 +429,7 @@ builder.AddMySqlDataSource("MySqConnection");
429429
### Configuration providers
430430

431431
The `Aspire:MySqlConnector` key is used to configure the MySQL integration.
432-
432+
433433
```json
434434
{
435435
"Aspire": {

learn-pr/aspnetcore/use-databases-dotnet-aspire-app/includes/test-aspire-projects.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
11
Testing is an essential part of developing high-quality software. Testing can help you find and fix bugs, improve performance, and ensure that your code meets the requirements and expectations of your users. Testing can also help you automate the deployment process and prevent regressions in the future. .NET Aspire provides tools and libraries to simplify the development, testing, and deployment of distributed applications.
22

3-
In this unit, you learn how to test .NET Aspire projects using xUnit, a popular testing framework for .NET. You learn how to create different types of tests, such as integration tests and functional tests, and how to run them using the .NET Aspire CLI or Visual Studio.
3+
In this unit, you learn how to test .NET Aspire projects using xUnit, a popular testing framework for .NET. You learn how to create different types of tests, such as integration tests and functional tests, and how to run them using the .NET Aspire CLI or Visual Studio.
44

5-
## Create a test project
5+
## Create a test project
66

77
The easiest way to create a .NET Aspire test project is to use the testing project template. You can use the `dotnet new` command to create a standard class library project, and then add the references to the .NET Aspire testing libraries and the xUnit packages.
88

99
```dotnetcli
1010
dotnet new aspire-xunit
1111
```
1212

13-
## Explore the test project
13+
## Explore the test project
1414

1515
The following example test project was created as part of the **.NET Aspire Starter Application** template. If you're unfamiliar with it, see [Quickstart: Build your first .NET Aspire project](/dotnet/aspire/get-started/build-your-first-aspire-app). The .NET Aspire test project takes a project reference dependency on the target app host. Consider the template project:
1616

learn-pr/aspnetcore/use-databases-dotnet-aspire-app/knowledge-check.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,10 +28,10 @@ quiz:
2828
choices:
2929
- content: "Connection strings in the appsettings.json file and inline code."
3030
isCorrect: false
31-
explanation: "That's incorrect. These two ways are supported but there are more."
31+
explanation: "That's incorrect. These two ways are supported, but there are more."
3232
- content: "With inline code and using Microsoft.Extensions.Configuration."
3333
isCorrect: false
34-
explanation: "That's incorrect. These two ways are supported but there are more."
34+
explanation: "That's incorrect. These two ways are supported, but there are more."
3535
- content: "Using Microsoft.Extensions.Configuration, connection strings, and inline code."
3636
isCorrect: true
3737
explanation: "That's correct. All of these ways are supported."

0 commit comments

Comments
 (0)