Update Program.cs example (#24361)
Utilize Microsoft.AspNetCore.Http.StatusCodes instead of integers for Produces() method of a endpoint mapping to utilize available convention within the AspNetCore framework.pull/24367/head
parent
36f989d350
commit
849e293175
|
@ -44,8 +44,8 @@ app.MapGet("/api/todoitems/{id}", async (int id, TodoDb db) =>
|
|||
is Todo todo
|
||||
? Results.Ok(todo)
|
||||
: Results.NotFound())
|
||||
.Produces<Todo>(200)
|
||||
.Produces(404);
|
||||
.Produces<Todo>(StatusCodes.Status200OK)
|
||||
.Produces(StatusCodes.Status404NotFound);
|
||||
#endregion
|
||||
|
||||
app.MapGet("/api/todoitems", async (TodoDb db) =>
|
||||
|
|
Loading…
Reference in New Issue