Ensure4Net 1.0.0

Inpired by CodeContracts, small piece of code that allows you to lower the ciclomatic complexity of code by removing some branching.
     Branching like most precondition, if - else - throw or if - else - set value.

Install-Package Ensure4Net -Version 1.0.0
dotnet add package Ensure4Net --version 1.0.0
<PackageReference Include="Ensure4Net" Version="1.0.0" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add Ensure4Net --version 1.0.0
The NuGet Team does not provide support for this client. Please contact its maintainers for support.

Github link: https://github.com/spiri91/Ensure.NET

Ensure.NET

Inpired by CodeContracts, small piece of code that allows you to lower the ciclomatic complexity of code by removing some branching.

Ensure.NET

Inpired by CodeContracts, small piece of code that allows you to lower the ciclomatic complexity of code by removing some branching.
Branching like most precondition, if - else - throw or if - else - set value.

Examples

if (foo == null)
    throw new NullReferenceException();
=> becomes
	Ensure.Condition(foo == boo, new NullReferenceException());

if (foo == goo)
    foo = boo;
=> becomes
    Ensure.Condition(foo == boo, ref foo, boo);

if (ObjectIsValid(foo))
    DoSomething();
=> becomes
    Ensure.Condition(() => ObjectIsValid(foo), () => DoSomething());

Github link: https://github.com/spiri91/Ensure.NET

Ensure.NET

Inpired by CodeContracts, small piece of code that allows you to lower the ciclomatic complexity of code by removing some branching.

Ensure.NET

Inpired by CodeContracts, small piece of code that allows you to lower the ciclomatic complexity of code by removing some branching.
Branching like most precondition, if - else - throw or if - else - set value.

Examples

if (foo == null)
    throw new NullReferenceException();
=> becomes
	Ensure.Condition(foo == boo, new NullReferenceException());

if (foo == goo)
    foo = boo;
=> becomes
    Ensure.Condition(foo == boo, ref foo, boo);

if (ObjectIsValid(foo))
    DoSomething();
=> becomes
    Ensure.Condition(() => ObjectIsValid(foo), () => DoSomething());

This package is not used by any popular GitHub repositories.

Version History

Version Downloads Last updated
1.0.0 281 1/30/2018