Multipleresultypes (#83)

pull/85/head
Samson Amaugo 2022-09-30 19:49:11 +01:00 committed by GitHub
parent e334b21a46
commit be491effeb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 0 deletions

View File

@ -36,5 +36,7 @@ app.MapGet("/book{id}", Results<Ok<Book>, NotFound> (int id, List<Book> bookList
: TypedResults.NotFound(); : TypedResults.NotFound();
}); });
app.MapGet("/books", (List<Book> bookList) => TypedResults.Ok(bookList));
app.Run(); app.Run();
record Book(int Id, string Title, string Author); record Book(int Id, string Title, string Author);