A friendly “email already taken” error in .NET 11.

The unique index still has to back it up.

WHAT THE USER SEES
Email
sara@example.com
This email is already registered.
[Required, EmailAddress, UniqueEmail]
an async check, before the handler
TWO SIGN-UPS, SAME EMAIL, SAME MOMENT
#1
check: free
→
INSERT · 201
#2
check: free
→
INSERT · rejected
UNIQUE INDEX ON Users.Email
UNIQUE constraint failed: Users.Email
caught and returned as the same 400
.NET 11 RC2 · AsyncValidationAttribute · EF Core on SQLite
gdhami.net