Skip to content

Commit ab04928

Browse files
authored
Add bullet points to action instructions in tutorial
1 parent cde49de commit ab04928

File tree

1 file changed

+12
-12
lines changed

1 file changed

+12
-12
lines changed

aspnetcore/tutorials/first-web-api.md

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -266,9 +266,9 @@ The *database context* is the main class that coordinates Entity Framework funct
266266

267267
In ASP.NET Core, services such as the DB context must be registered with the [dependency injection (DI)](xref:fundamentals/dependency-injection) container. The container provides the service to controllers.
268268

269-
Update `Program.cs` with the following highlighted code:
269+
* Update `Program.cs` with the following highlighted code:
270270

271-
[!code-csharp[](~/tutorials/first-web-api/samples/9.0/TodoApi/Program.cs?name=snippet_Final_Add_DBContext&highlight=1-2,9-10)]
271+
[!code-csharp[](~/tutorials/first-web-api/samples/9.0/TodoApi/Program.cs?name=snippet_Final_Add_DBContext&highlight=1-2,9-10)]
272272

273273
The preceding code:
274274

@@ -322,9 +322,9 @@ source ~/.bashrc
322322

323323
[!INCLUDE[](~/includes/dotnet-tool-install-arch-options.md)]
324324

325-
Build the project.
325+
* Build the project.
326326

327-
Run the following command:
327+
* Run the following command:
328328

329329
```dotnetcli
330330
dotnet aspnet-codegenerator controller -name TodoItemsController -async -api -m TodoItem -dc TodoContext -outDir Controllers
@@ -348,9 +348,9 @@ When the `[action]` token isn't in the route template, the [action](xref:mvc/con
348348

349349
## Update the PostTodoItem create method
350350

351-
In **Controllers/TodoItemsController.cs** update the return statement in the `PostTodoItem` to use the [nameof](/dotnet/csharp/language-reference/operators/nameof) operator:
351+
* In **Controllers/TodoItemsController.cs** update the return statement in the `PostTodoItem` to use the [nameof](/dotnet/csharp/language-reference/operators/nameof) operator:
352352

353-
[!code-csharp[](~/tutorials/first-web-api/samples/9.0/TodoApi/Controllers/TodoItemsController.cs?name=snippet_Create)]
353+
[!code-csharp[](~/tutorials/first-web-api/samples/9.0/TodoApi/Controllers/TodoItemsController.cs?name=snippet_Create)]
354354

355355
The preceding code is an `HTTP POST` method, as indicated by the [`[HttpPost]`](xref:Microsoft.AspNetCore.Mvc.HttpPostAttribute) attribute. The method gets the value of the `TodoItem` from the body of the HTTP request.
356356

@@ -401,7 +401,7 @@ Two GET endpoints are implemented:
401401

402402
The previous section showed an example of the `/api/todoitems/{id}` route.
403403

404-
Follow the [POST](#post7) instructions to add another todo item, and then test the `/api/todoitems` route using Swagger.
404+
* Follow the [POST](#post7) instructions to add another todo item, and then test the `/api/todoitems` route using Swagger.
405405

406406
This app uses an in-memory database. If the app is stopped and started, the preceding GET request doesn't return any data. If no data is returned, [POST](#post7) data to the app.
407407

@@ -442,7 +442,7 @@ Examine the `PutTodoItem` method:
442442

443443
This sample uses an in-memory database that must be initialized each time the app is started. There must be an item in the database before you make a PUT call. Call GET to ensure there's an item in the database before making a PUT call.
444444

445-
Using the Swagger UI, use the PUT button to update the `TodoItem` that has Id = 1 and set its name to `"feed fish"`. Note the response is [`HTTP 204 No Content`](https://developer.mozilla.org/docs/Web/HTTP/Status/204).
445+
* Using the Swagger UI, use the PUT button to update the `TodoItem` that has Id = 1 and set its name to `"feed fish"`. Note the response is [`HTTP 204 No Content`](https://developer.mozilla.org/docs/Web/HTTP/Status/204).
446446

447447
## The DeleteTodoItem method
448448

@@ -452,7 +452,7 @@ Examine the `DeleteTodoItem` method:
452452

453453
### Test the DeleteTodoItem method
454454

455-
Use the Swagger UI to delete the `TodoItem` that has Id = 1. Note the response is [`HTTP 204 No Content`](https://developer.mozilla.org/docs/Web/HTTP/Status/204).
455+
* Use the Swagger UI to delete the `TodoItem` that has Id = 1. Note the response is [`HTTP 204 No Content`](https://developer.mozilla.org/docs/Web/HTTP/Status/204).
456456

457457
## Test with other tools
458458

@@ -482,7 +482,7 @@ A DTO may be used to:
482482
* Omit some properties in order to reduce payload size.
483483
* Flatten object graphs that contain nested objects. Flattened object graphs can be more convenient for clients.
484484

485-
To demonstrate the DTO approach, update the `TodoItem` class to include a secret field:
485+
* To demonstrate the DTO approach, update the `TodoItem` class to include a secret field:
486486

487487
[!code-csharp[](~/tutorials/first-web-api/samples/9.0/TodoApiDTO/Models/TodoItem.cs?highlight=8)]
488488

@@ -494,9 +494,9 @@ Create a DTO model in a **Models/TodoItemsDTO.cs** file:
494494

495495
[!code-csharp[](~/tutorials/first-web-api/samples/9.0/TodoApiDTO/Models/TodoItemDTO.cs)]
496496

497-
Update the `TodoItemsController` to use `TodoItemDTO`:
497+
* Update the `TodoItemsController` to use `TodoItemDTO`:
498498

499-
[!code-csharp[](~/tutorials/first-web-api/samples/9.0/TodoApiDTO/Controllers/TodoItemsController.cs?highlight=25,28,34,43,49,51,62,63,89,93,94,100,124-130)]
499+
[!code-csharp[](~/tutorials/first-web-api/samples/9.0/TodoApiDTO/Controllers/TodoItemsController.cs?highlight=25,28,34,43,49,51,62,63,89,93,94,100,124-130)]
500500

501501
Verify you can't post or get the secret field.
502502

0 commit comments

Comments
 (0)