Created
April 12, 2020 15:51
-
-
Save dhavalmpanchal/66ec58036b32d9228b38e10be393061e to your computer and use it in GitHub Desktop.
addrating.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
endpoints.MapGet("/products", (context) => | |
{ | |
var products = app.ApplicationServices.GetService<JsonFileProductService>().GetProducts(); | |
var json = JsonSerializer.Serialize<IEnumerable<Product>>(products); | |
return context.Response.WriteAsync(json); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment