Skip to content

Instantly share code, notes, and snippets.

@AnthonyGiretti
Created November 24, 2025 01:30
Show Gist options
  • Select an option

  • Save AnthonyGiretti/310a8fc7019d2f02f569ed929872331c to your computer and use it in GitHub Desktop.

Select an option

Save AnthonyGiretti/310a8fc7019d2f02f569ed929872331c to your computer and use it in GitHub Desktop.
ASP.NET Core DataAnnotation unifications
// Before ASP.NET Core 10, depending on the scenario:
// Some attributes were ignored
// Record struct parameters weren’t validated consistently
// Constructor binding didn’t always trigger annotation checks.
public readonly record struct UserInput(
[Required] string Name,
[Range(18, 99)] int Age);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment