Skip to content
sunmeatPublic

About

Validate everything. Complicate nothing. A unified .NET API for argument checks, reusable validation rules and data validation.

Topics

Resources

Code of conduct

Contributing

Security policy

Accessibility

Stars

1 star

Watchers

0 watching

Forks

Latest commit

 

History

12 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Sunmeat.Guard logo

Sunmeat.Guard

Validate everything. Complicate nothing.

Guard validates arguments, objects, collections, text, numbers, files, and documents through one API for .NET.

NuGet CI MIT .NET Support development

Українська

Install

Current release: 1.0.0. Install from NuGet or build and install locally. Build and publish

Install this version using the .NET CLI:

dotnet add package Sunmeat.Guard --version 1.0.0

Guard targets .NET 8, 9, 10, and 11. See the platform matrix for verified runtimes. Compatibility

Quick start

Guard clauses

using Sunmeat.Guard;

string name = Guard.NotWhiteSpace("Ada");
int age = Guard.InRange(32, 18, 120);

Boolean checks

using Sunmeat.Guard;

bool canContinue = Guard.IsEmail("user@example.org") && Guard.IsPhone("+12025550123");

Fluent validation

using Sunmeat.Guard;

var validator = Guard.For<Registration>()
    .Rule(x => x.Name).NotWhiteSpace().MinLength(2)
    .Rule(x => x.Email).Email()
    .Rule(x => x.Age).Between(18, 120)
    .Build();

var result = validator.Validate(new Registration("Ada", "user@example.org", 32));
Console.WriteLine(result.ToText());

record Registration(string? Name, string? Email, int Age);

Validation rules

The core covers null and empty values, Unicode text, generic numbers, dates, collections, enumerations, passwords, web addresses, international identifiers, file signatures, JSON, and XML. Fluent rules support conditions, nested models, custom checks, and cancellation. Results can use English or Ukrainian and are available as JSON, text, Markdown, and HTML.

Built-in rule catalog · Fluent validation · Security

Optional packages

Package Use
Sunmeat.Guard.Documents YAML, TOML, CBOR, and XML Schema
Sunmeat.Guard.AspNetCore Endpoint filters and Problem Details
Sunmeat.Guard.Blazor EditContext form validation
Sunmeat.Guard.Prism Export reports in six formats
Sunmeat.Guard.Pulse Structured counts and terminal reports

Documentation and examples

Getting started and examples · Measured benchmarks · Localization

Sunmeat ecosystem

Independent .NET libraries with a shared philosophy: simple APIs, modularity and open source.

Library Purpose NuGet / Status
Sunmeat.Prism Serialization and format conversion NuGet
Sunmeat.Pulse Structured logging NuGet
Sunmeat.Nexus HTTP requests and API communication NuGet
Sunmeat.Lens Code analysis and architecture visualization NuGet · Roslyn · Raster
Sunmeat.Guard (this project) Validation and argument checks NuGet
Sunmeat.Diff Data comparison and patches NuGet
Sunmeat.Morph Object mapping and transformation NuGet
Sunmeat.Forge Synthetic data and test fixtures NuGet
Sunmeat.Signal Multichannel notifications NuGet · Extensions.DependencyInjection
Sunmeat.Vault Cryptography and secret storage NuGet
Sunmeat.Portal File systems, storage and backups NuGet
Sunmeat.Scribe Document generation and processing In development
Sunmeat.Flux In-process Mediator, CQRS and Event Bus In development
Sunmeat.Synapse Unified AI API and model routing In development

All published packages · Ecosystem website


❤️ Support the project

Sunmeat.Guard is free, open-source software created and maintained by an independent developer.

If Guard saves you time, simplifies validation, or becomes a valuable part of your projects, consider supporting its continued development.

Your support helps fund:

  • New validation rules and supported data formats.
  • Performance improvements and optimizations.
  • Localization and international standards support.
  • Documentation, examples, and automated tests.
  • Long-term maintenance and compatibility.
  • New open-source .NET libraries and developer tools.

Every contribution, regardless of its size, makes a difference.

Support development Patreon Monobank Star on GitHub Developer website

You can also support the project by starring the repository, reporting issues, contributing code, or sharing Guard with other developers.


Built with curiosity. Shared with the community.

Copyright © 2026 Oleksandr Zahoruiko · sunmeat.dev

About

Validate everything. Complicate nothing. A unified .NET API for argument checks, reusable validation rules and data validation.

Topics

Resources

Code of conduct

Contributing

Security policy

Accessibility

Stars

1 star

Watchers

0 watching

Forks

Releases

Sponsor this project

Packages

Contributors

Languages