Limen 0.2.1

Suggested Alternatives

Cordon

Additional Details

请使用 Cordon 替代 Limen 包。

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

Limen

license nuget dotNET China

Limen 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, Limen 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 Limen

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.ContinueWith<User>()
            .RuleFor(u => u.Name).NotBlank().MinLength(3).UserName().WithMessage("{0} 不是有效的互联网用户名")
            .RuleFor(u => u.Id).Max(int.MaxValue)
            .RuleSet("rule", validator => 
            {
                validator.RuleFor(u => u.Name).EmailAddress().WithMessage("{0} 不是有效的电子邮箱格式");
            }).ToResults();
    }
}

More Documentation

Documentation

You can find the Limen documentation on our homepage.

Contributing

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

License

Limen 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 (1)

Showing the top 1 NuGet packages that depend on Limen:

Package Downloads
Limen.AspNetCore

Furion 框架数据验证模块。

GitHub repositories

This package is not used by any popular GitHub repositories.