From c3e567494c13a17b5be2ea85b7b4db284bc96e2c Mon Sep 17 00:00:00 2001 From: Drew Rautenberg Date: Wed, 8 Jan 2025 16:57:51 -0600 Subject: [PATCH] updates --- barkmanAPI/Program.cs | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/barkmanAPI/Program.cs b/barkmanAPI/Program.cs index 408d7d3..9a5a67d 100644 --- a/barkmanAPI/Program.cs +++ b/barkmanAPI/Program.cs @@ -1,6 +1,7 @@ using Microsoft.EntityFrameworkCore; using Microsoft.OpenApi.Models; + var builder = WebApplication.CreateBuilder(args); builder.Services.AddDbContext(); @@ -29,12 +30,6 @@ app.MapGet("/inventory", async (InventoryContext dbContext) => return Results.Ok(inventoryItems); }); -app.MapPost("/inventory", async (InventoryContext dbContext, InventoryContext newItem) => -{ - dbContext.Add(newItem); - await dbContext.SaveChangesAsync(); - return Results.Created($"/inventory/{newItem.Id}", newItem); -}); //app.MapGet("/inventory/{id}", (int id) => InventoryDb.GetInventory(id)); //app.MapPut("/inventory", (InventoryItem item) => InventoryDb.UpdateItem(item)); //app.MapDelete("/inventory/{id}", (int id) => InventoryDb.RemoveItem(id));