Limen 0.2.1
请使用 Cordon 替代 Limen 包。
dotnet add package Limen --version 0.2.1
NuGet\Install-Package Limen -Version 0.2.1
<PackageReference Include="Limen" Version="0.2.1" />
<PackageVersion Include="Limen" Version="0.2.1" />
<PackageReference Include="Limen" />
paket add Limen --version 0.2.1
#r "nuget: Limen, 0.2.1"
#:package Limen@0.2.1
#addin nuget:?package=Limen&version=0.2.1
#tool nuget:?package=Limen&version=0.2.1
Limen
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();
}
}
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.
| 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
-
net8.0
-
net9.0
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.