mirror of
https://github.com/BarkProductions/barkman.git
synced 2026-06-12 22:11:54 +00:00
updates
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.OpenApi.Models;
|
||||
|
||||
|
||||
var builder = WebApplication.CreateBuilder(args);
|
||||
|
||||
builder.Services.AddDbContext<InventoryContext>();
|
||||
@@ -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));
|
||||
|
||||
Reference in New Issue
Block a user