Conform.Net.Annotations
0.1.0-preview.1
dotnet add package Conform.Net.Annotations --version 0.1.0-preview.1
NuGet\Install-Package Conform.Net.Annotations -Version 0.1.0-preview.1
<PackageReference Include="Conform.Net.Annotations" Version="0.1.0-preview.1" />
<PackageVersion Include="Conform.Net.Annotations" Version="0.1.0-preview.1" />
<PackageReference Include="Conform.Net.Annotations" />
paket add Conform.Net.Annotations --version 0.1.0-preview.1
#r "nuget: Conform.Net.Annotations, 0.1.0-preview.1"
#:package Conform.Net.Annotations@0.1.0-preview.1
#addin nuget:?package=Conform.Net.Annotations&version=0.1.0-preview.1&prerelease
#tool nuget:?package=Conform.Net.Annotations&version=0.1.0-preview.1&prerelease
Conform.Net
Validate and normalize .NET object graphs in one pass. Conform checks nested objects and collections against
declarative contracts. Every problem is reported with an exact path (Lines[3].Barcode), and you get each value's
canonical form as a proposed change. Nothing is written to your objects until you call Apply().
- Validation + normalization in one contract; rules judge the normalized value
- Pure evaluation, plus an explicit, conflict-checked
Apply() - Nested objects, collections,
List<List<T>>, cycles and shared references - Structured findings: path, code, severity, expected, observed
- Works with the
DataAnnotationsattributes you already use (Conform.Net.Annotations) - Zero-dependency, AOT-compatible core
using Conform;
var registry = new ContractRegistry()
.Define<Order>(c =>
{
c.Member(o => o.Phone).Required()
.Normalize(Normalizers.DigitsOnly, Normalizers.KeepLast(10)) // "+90 (532) 123 45 67" → "5321234567"
.Matches(@"^5\d{9}$");
c.Member(o => o.Lines).Required().Count(min: 1).Descend();
});
var report = new ConformanceEngine(registry).Evaluate(order); // pure
if (report.IsConformant) report.Apply(); // commit canonical values
else return Results.ValidationProblem(report.ToErrorDictionary());
With attributes (Conform.Net.Annotations):
var registry = new ContractRegistry().UseAnnotations();
public class Customer
{
[Required, Trim, StringLength(60, MinimumLength = 2)] public string? Name { get; set; }
[Required, DigitsOnly(Order = 1), KeepLast(10, Order = 2)] public string? Phone { get; set; }
[Required, MinLength(1), Descend] public List<Address>? Addresses { get; set; }
}
📖 Documentation, comparison with FluentValidation/DataAnnotations, and benchmarks: https://github.com/Murat7Ay/AttributeBasedValidation
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | 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. |
-
net10.0
- Conform.Net (>= 0.1.0-preview.1)
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 |
|---|---|---|
| 0.1.0-preview.1 | 87 | 9/30/2026 |