Sunmeat.Guard 1.0.0

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

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

Version 1.0.0 is prepared for release. Before publication, build and install it from a local feed. Build and publish

After publication on NuGet.org, install that 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

Library Purpose
Sunmeat.Prism Serialization in six formats
Sunmeat.Pulse Structured logs, terminal output, and event pipelines
Sunmeat.Guard Argument checks and reusable validators

❤️ 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

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

Star on GitHub Developer website


Built with curiosity. Shared with the community.

Copyright © 2026 Oleksandr Zahoruiko · sunmeat.dev

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.  net11.0 is compatible. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
  • net10.0

    • No dependencies.
  • net11.0

    • No dependencies.
  • net8.0

    • No dependencies.
  • net9.0

    • No dependencies.

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
1.0.0 90 11/29/2026

Initial release of Sunmeat.Guard.