TooManyDataAnnotations 1.0.1
dotnet add package TooManyDataAnnotations --version 1.0.1
NuGet\Install-Package TooManyDataAnnotations -Version 1.0.1
<PackageReference Include="TooManyDataAnnotations" Version="1.0.1" />
<PackageVersion Include="TooManyDataAnnotations" Version="1.0.1" />
<PackageReference Include="TooManyDataAnnotations" />
paket add TooManyDataAnnotations --version 1.0.1
#r "nuget: TooManyDataAnnotations, 1.0.1"
#:package TooManyDataAnnotations@1.0.1
#addin nuget:?package=TooManyDataAnnotations&version=1.0.1
#tool nuget:?package=TooManyDataAnnotations&version=1.0.1
TooManyDataAnnotations
![]()
Extending .NET's
System.ComponentModel.DataAnnotationswith powerful, semantic validation attributes.
⚠️ Early adopters wanted. Newly published, seeking real-world feedback. 899 tests covering edge cases. Report issues here.
🚀 Quick Start
Install the package:
dotnet add package TooManyDataAnnotations
Add validation to your models:
using System.ComponentModel.DataAnnotations;
using TooManyDataAnnotations.Aot.Network;
using TooManyDataAnnotations.Aot.Formatting;
using TooManyDataAnnotations.Aot.Text;
using TooManyDataAnnotations.Classes;
public class ProductDto
{
[IPv4]
public string? ServerIp { get; set; }
[SemanticVersion]
public string? Version { get; set; }
[Required]
[HexColor]
public string? ThemeColor { get; set; }
}
[ExactlyOneOf(nameof(Email), nameof(Phone))]
public class ContactDto
{
public string? Email { get; set; }
public string? Phone { get; set; }
}
📦 Two Packages Available
TooManyDataAnnotations (this package)
Everything included — AOT-safe attributes + reflection-based validators.
Use this if you don't need Native AOT publishing.
TooManyDataAnnotations.Aot
AOT-only subset. Zero reflection. Use when publishing Native AOT applications.
dotnet add package TooManyDataAnnotations.Aot
💡 Tip: Installing
TooManyDataAnnotationsautomatically includesTooManyDataAnnotations.Aotas a dependency.
✨ Supported Validators
AOT-Safe (no reflection)
| Category | Attributes |
|---|---|
| Identifiers | [Guid], [GuidV7], [Uri] |
| Network | [IPv4], [IPv6], [MacAddress], [PortNumber] |
| Text | [HexColor], [Slug], [WebUrl] |
| Formatting | [IsoDateTime], [SemanticVersion] |
| Logical | [IsTrue], [IsFalse] |
Reflection-Based (full package only)
| Category | Attributes |
|---|---|
| Logical | [MinimumTrueValues], [AtLeastOneTrue], [ExactlyNTrue], [ExactlyOneTrue] |
| Classes | [ExactlyNOf], [ExactlyOneOf], [RequiredAtLeastN], [RequiredAtLeastOne] |
| Temporal | [StartDate], [EndDate] |
🧪 Testing
899 unit tests covering all attributes — valid/invalid inputs, edge cases, nullable types, custom error messages, and integration tests with Validator.TryValidateObject.
dotnet test
🔗 Links
- Solution README — Full project documentation
- AOT Package — AOT-only subset
📄 License
MIT License — Copyright © 2026 LuisAlfredo92
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net8.0 is compatible. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. net9.0 is compatible. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 is compatible. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
-
net10.0
- TooManyDataAnnotations.Aot (>= 1.0.1)
-
net8.0
- TooManyDataAnnotations.Aot (>= 1.0.1)
-
net9.0
- TooManyDataAnnotations.Aot (>= 1.0.1)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.