Example Program.cs
✓ Published0🌍 Public
Aabonello
Last edited Mar 15, 2026
Created on Mar 15, 2026
This example shows a complete minimal API backend for customer management, wired to a React frontend. It demonstrates EF Core’s `AppDbContext` for SQL Server data access, including `EnsureCreated` seeding of three initial customers. CORS policy `MyAllowSpecificOrigins` permits requests from `http://localhost:5173`. The code exposes `MapGet`, `MapPost`, `MapPut`, and `MapDelete` endpoints for CRUD operations, with Swagger enabled for development testing.
AI-generated description