Multipleresultypes (#83)
parent
e334b21a46
commit
be491effeb
|
@ -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);
|
||||||
|
|
Loading…
Reference in New Issue