Soenneker.Validators.Validator
4.0.738
Prefix Reserved
dotnet add package Soenneker.Validators.Validator --version 4.0.738
NuGet\Install-Package Soenneker.Validators.Validator -Version 4.0.738
<PackageReference Include="Soenneker.Validators.Validator" Version="4.0.738" />
<PackageVersion Include="Soenneker.Validators.Validator" Version="4.0.738" />
<PackageReference Include="Soenneker.Validators.Validator" />
paket add Soenneker.Validators.Validator --version 4.0.738
#r "nuget: Soenneker.Validators.Validator, 4.0.738"
#:package Soenneker.Validators.Validator@4.0.738
#addin nuget:?package=Soenneker.Validators.Validator&version=4.0.738
#tool nuget:?package=Soenneker.Validators.Validator&version=4.0.738
Soenneker.Validators.Validator
Marker and logging base types used by Soenneker validator packages.
Install
dotnet add package Soenneker.Validators.Validator
Types
IValidatoris an empty marker interface. It does not define a commonValidatemethod because individual validators have different inputs, outputs, and async requirements.Validatoris an abstract base class that implements the marker and stores anILogger<Validator>for derived classes.
This package does not register services with dependency injection and is not useful as a standalone validation engine.
Build a validator
Define the operation on a domain-specific interface:
using Soenneker.Validators.Validator.Abstract;
public interface IOrderNumberValidator : IValidator
{
bool Validate(string? value);
}
Then derive from the logging base when shared logger access is useful:
using Microsoft.Extensions.Logging;
public sealed class OrderNumberValidator :
Soenneker.Validators.Validator.Validator,
IOrderNumberValidator
{
public OrderNumberValidator(ILogger<OrderNumberValidator> logger)
: base(logger)
{
}
public bool Validate(string? value)
{
bool valid = !string.IsNullOrWhiteSpace(value);
if (!valid)
Logger.LogDebug("Order number was missing");
return valid;
}
}
ILogger<TCategoryName> is covariant, so a derived validator's typed logger can be passed to the base constructor. The exposed Logger property is typed as ILogger<Validator> and has a public setter; avoid replacing it after construction unless the validator explicitly requires mutable logging behavior.
Registration lifetime and disposal belong to each concrete validator package because this base class owns no resources beyond the logger reference.
| 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
- Microsoft.Extensions.Logging.Abstractions (>= 10.0.11)
NuGet packages (16)
Showing the top 5 NuGet packages that depend on Soenneker.Validators.Validator:
| Package | Downloads |
|---|---|
|
Soenneker.Validators.Email.Disposable.Online
A validation module checking for disposable email addresses via online sources |
|
|
Soenneker.Validators.Email.Disposable
Checks whether an email address uses a disposable or temporary domain. |
|
|
Soenneker.Cloudflare.Turnstile.Validator
Server-side validation of Cloudflare Turnstile tokens through the Siteverify API. |
|
|
Soenneker.Validators.Email.Mx
A validation module checking for the existence of domain MX records |
|
|
Soenneker.Validators.ZipCode.Exists
Validates US ZIP codes against a packaged data snapshot |
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 4.0.738 | 1,285 | 9/4/2026 |
| 4.0.737 | 2,081 | 8/30/2026 |
| 4.0.736 | 1,300 | 8/29/2026 |
| 4.0.735 | 148 | 8/29/2026 |
| 4.0.734 | 6,163 | 8/12/2026 |
| 4.0.733 | 5,074 | 7/27/2026 |
| 4.0.732 | 6,059 | 7/16/2026 |
| 4.0.731 | 1,686 | 7/14/2026 |
| 4.0.730 | 6,187 | 6/18/2026 |
| 4.0.729 | 4,119 | 6/9/2026 |
| 4.0.728 | 2,806 | 6/5/2026 |
| 4.0.726 | 4,012 | 5/12/2026 |
| 4.0.724 | 5,153 | 4/21/2026 |
| 4.0.723 | 2,421 | 4/14/2026 |
| 4.0.722 | 5,085 | 3/12/2026 |
| 4.0.721 | 331 | 3/12/2026 |
| 4.0.720 | 396 | 3/12/2026 |
| 4.0.717 | 3,357 | 3/10/2026 |
| 4.0.716 | 562 | 3/10/2026 |
| 4.0.715 | 1,431 | 3/9/2026 |
Add interface inheritdoc references