From aab1e7bf5b2f295f8cac5403714feb7031eda4cb Mon Sep 17 00:00:00 2001 From: Safia Abdalla Date: Tue, 10 Oct 2023 13:33:02 -0700 Subject: [PATCH] Fix failing RDG009 case --- fundamentals/aot/diagnostics/Rdg9/Program.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/fundamentals/aot/diagnostics/Rdg9/Program.cs b/fundamentals/aot/diagnostics/Rdg9/Program.cs index 2059175..a53c43c 100644 --- a/fundamentals/aot/diagnostics/Rdg9/Program.cs +++ b/fundamentals/aot/diagnostics/Rdg9/Program.cs @@ -64,8 +64,7 @@ var app = builder.Build(); app.MapGet("/v1/todos/{id}", ([AsParameters] TodoItemRequest request) => { - return request.todos.ToList().Find(todoItem => todoItem.Id == request.Id) -is Todo todo + return request.todos.ToList().Find(todoItem => todoItem.Id == request.Id) is Todo todo ? Results.Ok(todo) : Results.NotFound(); }); @@ -75,6 +74,7 @@ app.Run(); struct TodoItemRequest { public int Id { get; set; } + [AsParameters] public Todo[] todos { get; set; } }