Fluent API for code contract validation supporting multiple data types (int, long, double, decimal, float, string, object). Provides chainable guards with readable syntax for enforcing preconditions and business rules with clear error messages.
License
—
Deps
4
Install Size
—
Vulns
✓ 0
Published
Dec 10, 2025
$ dotnet add package SolTechnology.Core.GuardsThe SolTechnology.Core.Guards library provides functionality needed for code contracts. It is based on fluent api providing checks for the most popular data types.
For installing the library, reference SolTechnology.Core.Guards nuget package
No configuration is needed.
var guards = new Guards();
guards.Int(playerApiId, nameof(playerApiId), x=> x.NotZero())
.String(name, nameof(name), x=> x.NotNull().NotEmpty())
.ThrowOnError();
Invokes chain of checks on the given parameters. If one or more conditions are not met, the exception is thrown.