From 849e2931753e167115e0e702ca8ecae2deab3b80 Mon Sep 17 00:00:00 2001 From: Kelby Hunt Date: Fri, 17 Dec 2021 15:30:30 -0800 Subject: [PATCH] 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. --- aspnetcore/fundamentals/minimal-apis/samples/todo/Program.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/aspnetcore/fundamentals/minimal-apis/samples/todo/Program.cs b/aspnetcore/fundamentals/minimal-apis/samples/todo/Program.cs index b5297638ec..dba48cfc2d 100644 --- a/aspnetcore/fundamentals/minimal-apis/samples/todo/Program.cs +++ b/aspnetcore/fundamentals/minimal-apis/samples/todo/Program.cs @@ -44,8 +44,8 @@ app.MapGet("/api/todoitems/{id}", async (int id, TodoDb db) => is Todo todo ? Results.Ok(todo) : Results.NotFound()) - .Produces(200) - .Produces(404); + .Produces(StatusCodes.Status200OK) + .Produces(StatusCodes.Status404NotFound); #endregion app.MapGet("/api/todoitems", async (TodoDb db) =>