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

alternate text is missing from this package README image alternate text is missing from this package README image alternate text is missing from this package README image alternate text is missing from this package README image

Soenneker.Validators.Validator

Marker and logging base types used by Soenneker validator packages.

Install

dotnet add package Soenneker.Validators.Validator

Types

  • IValidator is an empty marker interface. It does not define a common Validate method because individual validators have different inputs, outputs, and async requirements.
  • Validator is an abstract base class that implements the marker and stores an ILogger<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 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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

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
Loading failed

Add interface inheritdoc references