mirror of
https://github.com/fiodarsazanavets/aspire-13-examples.git
synced 2026-06-20 12:23:14 +00:00
Update the code
This commit is contained in:
@@ -128,10 +128,7 @@ if (app.Environment.IsDevelopment())
|
|||||||
app.MapGet("/", () => "API service is running.");
|
app.MapGet("/", () => "API service is running.");
|
||||||
|
|
||||||
app.MapGet("/products",
|
app.MapGet("/products",
|
||||||
([FromServices] ProductsDbContext context) =>
|
([FromServices] ProductsDbContext context) => context.Products.ToArray());
|
||||||
{
|
|
||||||
return context.Products.ToArray();
|
|
||||||
});
|
|
||||||
|
|
||||||
app.MapDefaultEndpoints();
|
app.MapDefaultEndpoints();
|
||||||
|
|
||||||
|
|||||||
@@ -128,10 +128,7 @@ if (app.Environment.IsDevelopment())
|
|||||||
app.MapGet("/", () => "API service is running.");
|
app.MapGet("/", () => "API service is running.");
|
||||||
|
|
||||||
app.MapGet("/products",
|
app.MapGet("/products",
|
||||||
([FromServices] ProductsDbContext context) =>
|
([FromServices] ProductsDbContext context) => context.Products.ToArray());
|
||||||
{
|
|
||||||
return context.Products.ToArray();
|
|
||||||
});
|
|
||||||
|
|
||||||
app.MapDefaultEndpoints();
|
app.MapDefaultEndpoints();
|
||||||
|
|
||||||
|
|||||||
@@ -115,10 +115,7 @@ if (app.Environment.IsDevelopment())
|
|||||||
app.MapGet("/", () => "API service is running.");
|
app.MapGet("/", () => "API service is running.");
|
||||||
|
|
||||||
app.MapGet("/products",
|
app.MapGet("/products",
|
||||||
([FromServices] ProductsDbContext context) =>
|
([FromServices] ProductsDbContext context) => context.Products.ToArray());
|
||||||
{
|
|
||||||
return context.Products.ToArray();
|
|
||||||
});
|
|
||||||
|
|
||||||
app.MapDefaultEndpoints();
|
app.MapDefaultEndpoints();
|
||||||
|
|
||||||
|
|||||||
@@ -113,9 +113,6 @@ if (app.Environment.IsDevelopment())
|
|||||||
app.MapGet("/", () => "API service is running.");
|
app.MapGet("/", () => "API service is running.");
|
||||||
|
|
||||||
app.MapGet("/products",
|
app.MapGet("/products",
|
||||||
([FromServices] ProductsDbContext context) =>
|
([FromServices] ProductsDbContext context) => context.Products.ToArray());
|
||||||
{
|
|
||||||
return context.Products.ToArray();
|
|
||||||
});
|
|
||||||
|
|
||||||
app.Run();
|
app.Run();
|
||||||
Reference in New Issue
Block a user