Fix snippet syntax

pull/26525/head
Rick Anderson 2022-07-22 13:37:28 -10:00
parent 9c3db2662e
commit 961044d9fa
1 changed files with 6 additions and 6 deletions

View File

@ -17,17 +17,17 @@ if (app.Environment.IsDevelopment())
app.MapGet("/", () => "Hello World!"); app.MapGet("/", () => "Hello World!");
#region snippet_grp // <snippet_grp>
app.MapGet("/todoitems", async (TodoDb db) => app.MapGet("/todoitems", async (TodoDb db) =>
await db.Todos.ToListAsync()) await db.Todos.ToListAsync())
.WithTags("TodoGroup"); .WithTags("TodoGroup");
#endregion // </snippet_grp>
#region snippet_name // <snippet_name>
app.MapGet("/todoitems2", async (TodoDb db) => app.MapGet("/todoitems2", async (TodoDb db) =>
await db.Todos.ToListAsync()) await db.Todos.ToListAsync())
.WithName("GetToDoItems"); .WithName("GetToDoItems");
#endregion // </snippet_name>
app.MapGet("/todoitems/complete", async (TodoDb db) => app.MapGet("/todoitems/complete", async (TodoDb db) =>
await db.Todos.Where(t => t.IsComplete).ToListAsync()); await db.Todos.Where(t => t.IsComplete).ToListAsync());
@ -38,7 +38,7 @@ app.MapGet("/todoitems/{id}", async (int id, TodoDb db) =>
? Results.Ok(todo) ? Results.Ok(todo)
: Results.NotFound()); : Results.NotFound());
#region snippet_getCustom // <snippet_getCustom>
app.MapGet("/api/todoitems/{id}", async (int id, TodoDb db) => app.MapGet("/api/todoitems/{id}", async (int id, TodoDb db) =>
await db.Todos.FindAsync(id) await db.Todos.FindAsync(id)
is Todo todo is Todo todo
@ -46,7 +46,7 @@ app.MapGet("/api/todoitems/{id}", async (int id, TodoDb db) =>
: Results.NotFound()) : Results.NotFound())
.Produces<Todo>(StatusCodes.Status200OK) .Produces<Todo>(StatusCodes.Status200OK)
.Produces(StatusCodes.Status404NotFound); .Produces(StatusCodes.Status404NotFound);
#endregion // </snippet_getCustom>
app.MapGet("/api/todoitems", async (TodoDb db) => app.MapGet("/api/todoitems", async (TodoDb db) =>
await db.Todos.ToListAsync()) await db.Todos.ToListAsync())