using WebApplication1.models; var builder = WebApplication.CreateBuilder(args); var app = builder.Build(); // сюда будем добавлять свои конечные точки var dbDataProvider = new DBDataProvider(); app.MapGet("/product", (int? pageNum) => { return dbDataProvider.getProduct(pageNum ?? 1); }); app.MapPost("/product", (Product newProduct) => { dbDataProvider.saveProduct(newProduct); }); app.MapPut("/product", (Product editProduct) => { dbDataProvider.saveProduct(editProduct); }); app.MapDelete( "/product/{id:int}", (int id) => { dbDataProvider.removeProduct(id); }); app.Run();