This commit is contained in:
2025-01-08 18:13:31 -06:00
parent 09e65ee0d1
commit 9ffaf27ca3
+6 -6
View File
@@ -4,7 +4,7 @@ using Microsoft.OpenApi.Models;
var builder = WebApplication.CreateBuilder(args); var builder = WebApplication.CreateBuilder(args);
builder.Services.AddDbContext<InventoryContext>(); builder.Services.AddDbContext<BarkContext>();
builder.Services.AddEndpointsApiExplorer(); builder.Services.AddEndpointsApiExplorer();
builder.Services.AddSwaggerGen(c => builder.Services.AddSwaggerGen(c =>
{ {
@@ -24,11 +24,11 @@ if (app.Environment.IsDevelopment())
app.MapGet("/", () => "Hello World!"); app.MapGet("/", () => "Hello World!");
app.MapGet("/inventory", async (InventoryContext dbContext) => // app.MapGet("/inventory", async (InventoryItems dbContext) =>
{ // {
var inventoryItems = await dbContext.Set<InventoryContext>().ToListAsync(); // var inventoryItems = await dbContext.Set<InventoryItems>().ToListAsync();
return Results.Ok(inventoryItems); // return Results.Ok(inventoryItems);
}); // });
//app.MapGet("/inventory/{id}", (int id) => InventoryDb.GetInventory(id)); //app.MapGet("/inventory/{id}", (int id) => InventoryDb.GetInventory(id));
//app.MapPut("/inventory", (InventoryItem item) => InventoryDb.UpdateItem(item)); //app.MapPut("/inventory", (InventoryItem item) => InventoryDb.UpdateItem(item));