Ensure.That 9.0.1

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 9.0.1
dotnet add package Ensure.That --version 9.0.1
<PackageReference Include="Ensure.That" Version="9.0.1" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add Ensure.That --version 9.0.1
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/releases

  • .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 80,550 6/7/2020
9.1.0 3,419 6/4/2020
9.0.1 58,702 4/29/2020
8.1.2 343,892 11/15/2019
8.1.1 724,325 1/7/2019
8.1.0 72,290 11/10/2018
8.0.0 405,381 4/29/2018
8.0.0-pre78 532 2/17/2018
8.0.0-pre71 426 2/14/2018
7.2.1 79,749 12/29/2017
7.2.0 19,243 12/14/2017
7.1.0 18,813 11/19/2017
7.1.0-pre50 666 11/15/2017
7.0.0 3,646 11/9/2017
7.0.0-pre43 674 11/9/2017
7.0.0-pre38 674 11/9/2017
7.0.0-pre37 666 10/31/2017
7.0.0-pre32 5,114 10/16/2017
7.0.0-pre24 715 9/27/2017
6.0.1 15,616 10/4/2017
6.0.1-pre28 397 10/3/2017
6.0.0 10,951 9/19/2017
6.0.0-pre18 444 9/14/2017
6.0.0-pre16 475 9/10/2017
6.0.0-pre15 428 9/10/2017
6.0.0-pre12 414 9/9/2017
6.0.0-pre11 481 9/7/2017
5.0.0 232,955 10/8/2016
5.0.0-b3 1,130 10/5/2016
4.0.0 154,722 11/24/2015
3.3.0 1,554 11/10/2015
3.2.0 2,256 9/28/2015
3.1.1 1,150 9/19/2015
3.1.0 2,035 8/30/2015
3.0.0 1,278 8/22/2015
2.0.0 33,353 7/2/2014
1.0.0 5,006 7/10/2013