Skip to content
This repository has been archived by the owner on Jul 10, 2024. It is now read-only.

Create endpoint on .NET6 #22

Open
ricardo202020 opened this issue Nov 29, 2022 · 0 comments
Open

Create endpoint on .NET6 #22

ricardo202020 opened this issue Nov 29, 2022 · 0 comments

Comments

@ricardo202020
Copy link

ricardo202020 commented Nov 29, 2022

app.MapGet("/products", (context) =>
{
IEnumerable products = app.Services.GetService().GetProducts();
var json = JsonSerializer.Serialize<IEnumerable>(products);
return context.Response.WriteAsync(json);
});

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant