d1-06-crud-endpoints
Installation
SKILL.md
Day 1 · Step 6 — CRUD endpoints, then redeploy
Before starting: Ask which entity to create endpoints for (must match one already migrated in D1_05). Do not assume or proceed without confirmation.
up-api/Controllers/<Entity>sController.cs:
[ApiController]
[Route("api/[controller]")]
public class <Entity>sController : ControllerBase
{
private readonly AppDbContext _db;
public <Entity>sController(AppDbContext db) => _db = db;
[HttpGet]
public async Task<IActionResult> All() => Ok(await _db.<Entity>s.ToListAsync());