TooManyDataAnnotations 1.0.1

dotnet add package TooManyDataAnnotations --version 1.0.1
                    
NuGet\Install-Package TooManyDataAnnotations -Version 1.0.1
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="TooManyDataAnnotations" Version="1.0.1" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="TooManyDataAnnotations" Version="1.0.1" />
                    
Directory.Packages.props
<PackageReference Include="TooManyDataAnnotations" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add TooManyDataAnnotations --version 1.0.1
                    
#r "nuget: TooManyDataAnnotations, 1.0.1"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package TooManyDataAnnotations@1.0.1
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=TooManyDataAnnotations&version=1.0.1
                    
Install as a Cake Addin
#tool nuget:?package=TooManyDataAnnotations&version=1.0.1
                    
Install as a Cake Tool

TooManyDataAnnotations

TooManyDataAnnotations Icon

Extending .NET's System.ComponentModel.DataAnnotations with powerful, semantic validation attributes.

NuGet .NET


⚠️ 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 TooManyDataAnnotations automatically includes TooManyDataAnnotations.Aot as 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


📄 License

MIT License — Copyright © 2026 LuisAlfredo92

Product 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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
1.0.1 104 8/2/2026
1.0.0 106 7/29/2026
0.1.0 101 7/21/2026