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));