ByteDev.ArgValidation 2.0.0

Set of helper methods to help validate arguments.

Install-Package ByteDev.ArgValidation -Version 2.0.0
dotnet add package ByteDev.ArgValidation --version 2.0.0
<PackageReference Include="ByteDev.ArgValidation" Version="2.0.0" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add ByteDev.ArgValidation --version 2.0.0
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: ByteDev.ArgValidation, 2.0.0"
#r directive can be used in F# Interactive, C# scripting and .NET Interactive. Copy this into the interactive tool or source code of the script to reference the package.
// Install ByteDev.ArgValidation as a Cake Addin
#addin nuget:?package=ByteDev.ArgValidation&version=2.0.0

// Install ByteDev.ArgValidation as a Cake Tool
#tool nuget:?package=ByteDev.ArgValidation&version=2.0.0
The NuGet Team does not provide support for this client. Please contact its maintainers for support.

ByteDev.ArgValidation

Set of helper methods to help validate arguments.

Installation

ByteDev.ArgValidation has been written as a .NET Standard 2.0 library, so you can consume it from a .NET Core or .NET Framework 4.6.1 (or greater) application.

ByteDev.ArgValidation is hosted as a package on nuget.org. To install from the Package Manager Console in Visual Studio run:

Install-Package ByteDev.ArgValidation

Further details can be found on the nuget page.

Release Notes

Releases follow semantic versioning.

Full details of the release notes can be viewed on GitHub.

Usage

All argument validation can be performed through the ArgValidator class. This class has a number of static methods:

  • DependencyNotNull
  • GreaterThan
  • GreaterThanOrEqual
  • In
  • LessThan
  • LessThanOrEqual
  • NotDefault
  • NotEmpty
  • NotEquals
  • NotIn
  • NotNull
  • NotNullOrEmpty

Example:

public Customer GetCustomer(int id)
{
	ArgValidator.GreaterThan(id, 0, nameof(id));

	// ...
}

ByteDev.ArgValidation

Set of helper methods to help validate arguments.

Installation

ByteDev.ArgValidation has been written as a .NET Standard 2.0 library, so you can consume it from a .NET Core or .NET Framework 4.6.1 (or greater) application.

ByteDev.ArgValidation is hosted as a package on nuget.org. To install from the Package Manager Console in Visual Studio run:

Install-Package ByteDev.ArgValidation

Further details can be found on the nuget page.

Release Notes

Releases follow semantic versioning.

Full details of the release notes can be viewed on GitHub.

Usage

All argument validation can be performed through the ArgValidator class. This class has a number of static methods:

  • DependencyNotNull
  • GreaterThan
  • GreaterThanOrEqual
  • In
  • LessThan
  • LessThanOrEqual
  • NotDefault
  • NotEmpty
  • NotEquals
  • NotIn
  • NotNull
  • NotNullOrEmpty

Example:

public Customer GetCustomer(int id)
{
	ArgValidator.GreaterThan(id, 0, nameof(id));

	// ...
}

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version History

Version Downloads Last updated
2.0.0 58 1/25/2021
1.0.1 55 1/20/2021
1.0.0 262 2/5/2020