Cordon.AspNetCore 0.1.2

dotnet add package Cordon.AspNetCore --version 0.1.2
                    
NuGet\Install-Package Cordon.AspNetCore -Version 0.1.2
                    
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="Cordon.AspNetCore" Version="0.1.2" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Cordon.AspNetCore" Version="0.1.2" />
                    
Directory.Packages.props
<PackageReference Include="Cordon.AspNetCore" />
                    
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 Cordon.AspNetCore --version 0.1.2
                    
#r "nuget: Cordon.AspNetCore, 0.1.2"
                    
#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 Cordon.AspNetCore@0.1.2
                    
#: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=Cordon.AspNetCore&version=0.1.2
                    
Install as a Cake Addin
#tool nuget:?package=Cordon.AspNetCore&version=0.1.2
                    
Install as a Cake Tool

Cordon

license nuget dotNET China

Cordon is a highly expressive data validation library built for .NET developers. With its fluent syntax and extensible rule engine, it establishes precise "guardrails" for data flows. Whether validating API inputs, form submissions, or cleansing heterogeneous data streams, Cordon enables enterprise-grade validation with minimal code.

Features

  • Non-intrusive Integration: No configuration required—integrate directly into existing projects.
  • Fluent Validation Syntax: Chainable, declarative APIs that make validation logic clear and readable.
  • Comprehensive Coverage: Full validation support for fields, objects, nested structures, and collections.
  • Scenario-based Rule Activation: Dynamically compose validation logic based on business requirements.
  • Multilingual Support: Built-in internationalization with error messages available in multiple languages.
  • Highly Customizable: Define custom validation logic and validation attributes to fit any business rule.
  • Dependency Injection Friendly: Register directly into the .NET service container.
  • Asynchronous Validation Support: Validation logic can be executed asynchronously; both sync and async scenarios are fully supported.
  • Flexible Architecture: Designed for ease of use, extension, and maintainability.
  • Cross-platform and Dependency-free: Runs on all major platforms with zero external dependencies.
  • High-Quality Code Assurance: Built under strict coding standards, with 98% unit and integration test coverage.
  • .NET 8+ Compatibility: Fully compatible with .NET 8 and later versions.

Installation

dotnet add package Cordon

Getting Started

We have many examples on our homepage. Here's your first one to get you started:

public class User : IValidatableObject
{
    [Min(1, ErrorMessage = "{0} must not be less than 1")]
    public int Id { get; set; }

    [Required]
    public string? Name { get; set; }

    public IEnumerable<ValidationResult> Validate(ValidationContext context)
    {
        return context.With<User>()
            .RuleFor(u => u.Name).NotBlank().MinLength(3).UserName().WithMessage("{0} is not a valid internet username")
            .RuleFor(u => u.Id).Max(int.MaxValue)
            // Support rule sets (scenarios)
            .RuleSet("rule", v => 
            {
                v.RuleFor(u => u.Name).EmailAddress().WithMessage({0} is not a valid email format");
            }).ToResults();
    }
}

More Documentation

Documentation

You can find the Cordon documentation on our homepage.

Contributing

The main purpose of this repository is to continue developing the core of Cordon, making it faster and easier to use. The development of Cordon is publicly hosted on Gitee, and we appreciate community contributions for bug fixes and improvements.

License

Cordon is released under the MIT open source license.

alternate text is missing from this package README image

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
0.1.2 0 12/30/2025
0.1.1 0 12/30/2025
0.1.0 26 12/30/2025
0.0.9 38 12/29/2025
0.0.8 38 12/29/2025
0.0.7 62 12/26/2025
0.0.6 120 12/25/2025
0.0.5 123 12/23/2025
0.0.4 118 12/22/2025
0.0.3 120 12/22/2025
0.0.2 124 12/22/2025