Lyo.Validation.Models
2.0.0
dotnet add package Lyo.Validation.Models --version 2.0.0
NuGet\Install-Package Lyo.Validation.Models -Version 2.0.0
<PackageReference Include="Lyo.Validation.Models" Version="2.0.0" />
<PackageVersion Include="Lyo.Validation.Models" Version="2.0.0" />
<PackageReference Include="Lyo.Validation.Models" />
paket add Lyo.Validation.Models --version 2.0.0
#r "nuget: Lyo.Validation.Models, 2.0.0"
#:package Lyo.Validation.Models@2.0.0
#addin nuget:?package=Lyo.Validation.Models&version=2.0.0
#tool nuget:?package=Lyo.Validation.Models&version=2.0.0
Lyo.Validation.Models
Lyo.Validation's contract half. Hosts that only exchange or persist validation rules — an API that returns ValidationSchema documents, a Postgres store that saves them — take these types and skip the validators, builders, and attributes that implement them.
The projection from a match explanation to errors lives here as well. WhereClauseExplainResult.ToErrors used to sit in Lyo.Query.Models, which made the query model reference Lyo.Result for one validation-only method. That edge went away when the method moved.
The Lyo.Validation namespace stayed on the types, so importers did not have to change when they moved.
Features
- Schema documents.
ValidationSchema— optional target type, key,WhereClauseconstraints, and per-field message overrides. - Message overrides. Dotted field paths key
ValidationMessageandWhereClauseErrorOverride. - Contracts.
IValidationRule<T>,IValidator<T>,IValidationSchemaCompiler,IValidationSchemaStore,IValidationClauseEvaluator. - Error projection. A failed explain tree becomes
Lyo.Result.Errors throughWhereClauseExplainResultExtensions.ToErrors. - Metadata keys. Each error attaches
PropertyName/AttemptedValueviaValidationMetadataKeys.
Examples
Wire shape of a schema
using Lyo.Validation;
var schema = new ValidationSchema {
Key = "signup.v2",
TargetTypeName = nameof(CreateUserRequest),
Constraints = new GroupClause(GroupOperatorEnum.And, [
new ConditionClause("Email", ComparisonOperatorEnum.Regex, @"^[^@]+@[^@]+$"),
new ConditionClause("Age", ComparisonOperatorEnum.GreaterThanOrEqual, 18),
]),
Messages = new Dictionary<string, ValidationMessage> {
["Age"] = new() { ErrorCode = "AGE_MIN", ErrorMessage = "Must be 18 or older." },
},
};
Package contents
ValidationMessage,ValidationSchema— the serializable rule document.IValidationRule<T>,IValidator<T>,ValidationRule<T>— validation abstractions and the delegate-backed rule.IValidationSchemaCompiler,IValidationSchemaStore— compile and load schemas.IValidationClauseEvaluator— where a schema meets whatever evaluates its clause.WhereClauseExplainResultExtensions,WhereClauseErrorOverride— explain tree toErrorprojection.ValidationMetadataKeys— metadata keys emitted by validation rules.
Dependencies
Generated from ProjectReference / PackageReference (same model as docs/Lyo.ProjectGraph.html).
Lyo.Exceptions(direct, lyo)Lyo.Query.Models(direct, lyo)Lyo.Result(direct, lyo)Lyo.Common.Core(transitive, lyo)Lyo.Common.Json(transitive, lyo)Lyo.Common.Metadata(transitive, lyo)Lyo.Parameters(transitive, lyo)Microsoft.Bcl.AsyncInterfaces10.0.5(transitive, microsoft, netstandard2.0)System.Memory4.6.3(transitive, microsoft, netstandard2.0)System.Text.Json10.0.5(transitive, microsoft, netstandard2.0)
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net5.0 was computed. net5.0-windows was computed. net6.0 was computed. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 was computed. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 was computed. 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 was computed. 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. |
| .NET Core | netcoreapp2.0 was computed. netcoreapp2.1 was computed. netcoreapp2.2 was computed. netcoreapp3.0 was computed. netcoreapp3.1 was computed. |
| .NET Standard | netstandard2.0 is compatible. netstandard2.1 was computed. |
| .NET Framework | net461 was computed. net462 was computed. net463 was computed. net47 was computed. net471 was computed. net472 was computed. net48 was computed. net481 was computed. |
| MonoAndroid | monoandroid was computed. |
| MonoMac | monomac was computed. |
| MonoTouch | monotouch was computed. |
| Tizen | tizen40 was computed. tizen60 was computed. |
| Xamarin.iOS | xamarinios was computed. |
| Xamarin.Mac | xamarinmac was computed. |
| Xamarin.TVOS | xamarintvos was computed. |
| Xamarin.WatchOS | xamarinwatchos was computed. |
-
.NETStandard 2.0
- Lyo.Exceptions (>= 2.0.0)
- Lyo.Query.Models (>= 2.0.0)
- Lyo.Result (>= 2.0.0)
-
net10.0
- Lyo.Exceptions (>= 2.0.0)
- Lyo.Query.Models (>= 2.0.0)
- Lyo.Result (>= 2.0.0)
NuGet packages (1)
Showing the top 1 NuGet packages that depend on Lyo.Validation.Models:
| Package | Downloads |
|---|---|
|
Lyo.Validation
Reusable validators and a fluent builder for validating strongly typed models with structured Result-based failures. |
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 2.0.0 | 435 | 9/9/2026 |