Baike.dev
All toolsOnline toolsAI codingTrendingOpen sourceNewsSubmit
Log in
< Back to tools
M

MiniValidation

> 编程语言
Open source

A minimalist validation library for .NET built atop the existing features in `System.ComponentModel.DataAnnotations` namespace

390 stars0 likes0 views
WebsiteGitHub

About

A minimalist validation library for .NET built atop the existing features in `System.ComponentModel.DataAnnotations` namespace

MiniValidation

A minimalistic validation library built atop the existing features in .NET's System.ComponentModel.DataAnnotations namespace. Adds support for single-line validation calls and recursion with cycle detection.

Supports .NET Standard 2.0 compliant runtimes.

Installation

Install the library from NuGet:

bash
❯ dotnet add package MiniValidation

ASP.NET Core 8+ Projects

If installing into an ASP.NET Core 8+ project, consider using the MinimalApis.Extensions package instead, which adds extensions specific to ASP.NET Core, including a validation endpoint filter:

bash
❯ dotnet add package MinimalApis.Extensions

Example usage

Validate an object

csharp
var widget = new Widget { Name = "" };

var isValid = MiniValidator.TryValidate(widget, out var errors);

class Widget
{
    [Required, MinLength(3)]
    public string Name { get; set; }

    public override string ToString() => Name;
}

Use services from validators

…

Console app

…
bash
❯ widget.exe
Widget 'widget' is valid!
Widget has errors!
  Name:
  - Cannot name a widget 'widget'.

❯ widget.exe Ok
Widget has errors!
  Name:
  - The field Name must be a string or array type with a minimum length of '3'.
Widget has errors!
  Name:
  - The field Name must be a string or array type with a minimum length of '3'.

❯ widget.exe Widget
Widget 'Widget' is valid!
Widget has errors!
  Name:
  - Cannot name a widget 'Widget'.

❯ widget.exe MiniValidation
Widget 'MiniValidation' is valid!
Widget 'MiniValidation' is valid!

Web app (.NET 8+)

…

Issues· 0 open

View all issuesOpen on GitHub

No open issues yet, or sync has not completed.

> Tags

C#

No comments yet. Be the first to share.

> Details

PublishedAug 1, 2026
UpdatedSep 17, 2026
Category编程语言
PricingOpen source

> Related tools

T
TypeScript
JavaScript 的超集,为前端与全栈提供静态类型
P
Python
通用编程语言,广泛用于 Web、数据与 AI
G
Go
Google 推出的简洁高效系统语言