By the end of Day 2, you will be able to:
- Configure Entity Framework Core 10 with PostgreSQL
- Design entity relationships using Fluent API configuration
- Implement request validation using FluentValidation and built-in .NET 10 validation
- Return standardized error responses using RFC 9457 Problem Details
Quick review questions from Day 1:
- What is the difference between
Results.Ok()andTypedResults.Ok()? - How do route groups help organize a Minimal API?
- What replaced Swashbuckle in .NET 10?
- Name three HTTP status codes and when to use them.
- Entity Framework Core 10 — DbContext, Fluent API, relationships, migrations, LINQ queries, N+1 prevention, new EF Core 10 features (LeftJoin, JSON columns)
- Validation — .NET 10 built-in validation, FluentValidation, endpoint filters, ValidationProblemDetails
- Problem Details & Error Handling — RFC 9457, IExceptionHandler, global error handling strategies
Lab 2 — Persistence & Validation: Add PostgreSQL persistence with EF Core, implement FluentValidation rules, and handle errors with Problem Details.
Scaffold level: 60% (DbContext skeleton provided, write configurations and validation)
- Day 2 Persistence, Validation & Error Handling Cheat Sheet — condensed notes for the essential day 2 topics with direct links into the companion code
- Day 2 demos — runnable SQLite and PostgreSQL reference APIs showing EF Core setup, migrations, validation filters, Problem Details, and
.httprequests
| Package | Purpose |
|---|---|
Microsoft.EntityFrameworkCore |
ORM framework |
Npgsql.EntityFrameworkCore.PostgreSQL |
PostgreSQL provider |
Microsoft.EntityFrameworkCore.Design |
Migration tooling |
FluentValidation.DependencyInjectionExtensions |
Validation with DI |