Ensure.That 8.1.0

Argument validation made simple and unified. It ensures arguments conforms to simple validation rules and provides an uniformed exception throwing strategy if arguments are invalid.

There is a newer version of this package available.
See the version list below for details.
Install-Package Ensure.That -Version 8.1.0
dotnet add package Ensure.That --version 8.1.0
<PackageReference Include="Ensure.That" Version="8.1.0" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add Ensure.That --version 8.1.0
The NuGet Team does not provide support for this client. Please contact its maintainers for support.

Using extension methods

Ensure.That(myString).IsNotNullOrWhiteSpace();
Ensure.That(myString, nameof(myArg)).IsNotNullOrWhiteSpace();
Ensure.That(myString, nameof(myArg), opts => opts.WithMessage("Foo")).IsNotNullOrWhiteSpace();

Using contextual validation

Ensure.String.IsNotNullOrWhiteSpace(myString);
Ensure.String.IsNotNullOrWhiteSpace(myString, nameof(myArg));
Ensure.String.IsNotNullOrWhiteSpace(myString, nameof(myArg), opts => opts.WithMessage("Foo"));

Using static simple methods

EnsureArg.IsNotNullOrWhiteSpace(myString);
EnsureArg.IsNotNullOrWhiteSpace(myString, nameof(myArg));
EnsureArg.IsNotNullOrWhiteSpace(myString, nameof(myArg), opts => opts.WithMessage("Foo"));

Using extension methods

Ensure.That(myString).IsNotNullOrWhiteSpace();
Ensure.That(myString, nameof(myArg)).IsNotNullOrWhiteSpace();
Ensure.That(myString, nameof(myArg), opts => opts.WithMessage("Foo")).IsNotNullOrWhiteSpace();

Using contextual validation

Ensure.String.IsNotNullOrWhiteSpace(myString);
Ensure.String.IsNotNullOrWhiteSpace(myString, nameof(myArg));
Ensure.String.IsNotNullOrWhiteSpace(myString, nameof(myArg), opts => opts.WithMessage("Foo"));

Using static simple methods

EnsureArg.IsNotNullOrWhiteSpace(myString);
EnsureArg.IsNotNullOrWhiteSpace(myString, nameof(myArg));
EnsureArg.IsNotNullOrWhiteSpace(myString, nameof(myArg), opts => opts.WithMessage("Foo"));

Release Notes

https://github.com/danielwertheim/ensure.that/blob/master/ReleaseNotes.md

  • .NETFramework 4.5.1

    • No dependencies.
  • .NETStandard 1.1

  • .NETStandard 2.0

    • No dependencies.

NuGet packages (63)

Showing the top 5 NuGet packages that depend on Ensure.That:

Package Downloads
MyCouch
MyCouch is a simple async CouchDB client building on top of the async HTTP client and uses JSON.Net to provide flexible serialization behaviour. It tries to keep the domain language of CouchDB and lets you work with requests and responses but also provides you with an alternative simplifying async API. MyCouch lets you work with raw JSON and/or entities/POCOS without requiring any implementation of interfaces or base-classes etc.
PMoney.Inventory
Consumes a generic inventory document store to be used in PMoney applications.
PineCone
Deprecated, see Structurizer instead: https://www.nuget.org/packages/Structurizer/ PineCone takes an instance of an C# class and builds a class-schema for it. This schema is then used to extract all primitive .Net types in the object-graph using some IL-Emits and then turns this to a key-value structure with paths and values. PineCone has been extracted from the open source document-oriented provider for SQL-server, SisoDb (http://sisodb.com).
iGamingCloud.SDK
This SDK is meant to help .NET developers integrate with the iGamingCloud API
Ark.Tools.Core
Core language tools or utilities over dependencies

GitHub repositories (5)

Showing the top 5 popular GitHub repositories that depend on Ensure.That:

Repository Stars
tidusjar/Ombi
Want a Movie or TV Show on Plex or Emby? Use Ombi!
asc-lab/dotnetcore-microservices-poc
Very simplified insurance sales system made in a microservices architecture using .NET Core
microsoft/fhir-server
A service that implements the FHIR standard
danielwertheim/mycouch
MyCouch is the asynchronous CouchDB client for .NET
tugberkugurlu/AspNetCore.Identity.MongoDB
MongoDB Data Store Adaptor for ASP.NET Core Identity

Version History

Version Downloads Last updated
9.2.0 83,068 6/7/2020
9.1.0 3,492 6/4/2020
9.0.1 59,084 4/29/2020
8.1.2 345,248 11/15/2019
8.1.1 726,752 1/7/2019
8.1.0 72,546 11/10/2018
8.0.0 406,248 4/29/2018
8.0.0-pre78 537 2/17/2018
8.0.0-pre71 431 2/14/2018
7.2.1 79,920 12/29/2017
7.2.0 19,259 12/14/2017
7.1.0 18,857 11/19/2017
7.1.0-pre50 671 11/15/2017
7.0.0 3,653 11/9/2017
7.0.0-pre43 678 11/9/2017
7.0.0-pre38 679 11/9/2017
7.0.0-pre37 671 10/31/2017
7.0.0-pre32 5,132 10/16/2017
7.0.0-pre24 727 9/27/2017
6.0.1 15,631 10/4/2017
6.0.1-pre28 402 10/3/2017
6.0.0 10,963 9/19/2017
6.0.0-pre18 447 9/14/2017
6.0.0-pre16 480 9/10/2017
6.0.0-pre15 433 9/10/2017
6.0.0-pre12 419 9/9/2017
6.0.0-pre11 487 9/7/2017
5.0.0 233,358 10/8/2016
5.0.0-b3 1,135 10/5/2016
4.0.0 155,120 11/24/2015
3.3.0 1,557 11/10/2015
3.2.0 2,261 9/28/2015
3.1.1 1,155 9/19/2015
3.1.0 2,041 8/30/2015
3.0.0 1,283 8/22/2015
2.0.0 33,401 7/2/2014
1.0.0 5,014 7/10/2013
Show less