Shuttle.Core.Contract 11.0.0

The ID prefix of this package has been reserved for one of the owners of this package by NuGet.org. Prefix Reserved
.NET Standard 2.0
dotnet add package Shuttle.Core.Contract --version 11.0.0
NuGet\Install-Package Shuttle.Core.Contract -Version 11.0.0
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="Shuttle.Core.Contract" Version="11.0.0" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add Shuttle.Core.Contract --version 11.0.0
#r "nuget: Shuttle.Core.Contract, 11.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 Shuttle.Core.Contract as a Cake Addin
#addin nuget:?package=Shuttle.Core.Contract&version=11.0.0

// Install Shuttle.Core.Contract as a Cake Tool
#tool nuget:?package=Shuttle.Core.Contract&version=11.0.0

Shuttle.Core.Contract

PM> Install-Package Shuttle.Core.Contract

A guard implementation that performs assertions/assumptions to prevent invalid code execution.

Guard

void Against<TException>(bool assertion, string message) 
	where TException : Exception

Throws exception TException with the given message if the assertion is false. If exception type TException does not have a constructor that accepts a message then an InvalidOperationException is thrown instead.


T AgainstNull<T>(T value, string name)

Throws a NullReferenceException if the given value is null; else returns the value.


string AgainstNullOrEmptyString(string value, string name)

Throws a NullReferenceException if the given value is null or empty/whitespace; else returns the value.


TEnum AgainstUndefinedEnum<TEnum>(object value, string name)

Throws an InvalidOperationException if the provided value cannot be found in the given TEnum; else returns the value as TEnum.


IEnumerable<T> AgainstEmptyEnumerable<T>(IEnumerable<T> enumerable, string name)

Throws an InvalidOperationException if the given enumerable does not contain any entries; else returns the enumerable.


public static void AgainstEmptyGuid(Guid value, string name)

Throws and ArgumentException when the value is equal to an empty Guid ({00000000-0000-0000-0000-000000000000}); else returns the value.

Product Versions
.NET net5.0 net5.0-windows net6.0 net6.0-android net6.0-ios net6.0-maccatalyst net6.0-macos net6.0-tvos net6.0-windows net7.0 net7.0-android net7.0-ios net7.0-maccatalyst net7.0-macos net7.0-tvos net7.0-windows
.NET Core netcoreapp2.0 netcoreapp2.1 netcoreapp2.2 netcoreapp3.0 netcoreapp3.1
.NET Standard netstandard2.0 netstandard2.1
.NET Framework net461 net462 net463 net47 net471 net472 net48
MonoAndroid monoandroid
MonoMac monomac
MonoTouch monotouch
Tizen tizen40 tizen60
Xamarin.iOS xamarinios
Xamarin.Mac xamarinmac
Xamarin.TVOS xamarintvos
Xamarin.WatchOS xamarinwatchos
Compatible target framework(s)
Additional computed target framework(s)
Learn more about Target Frameworks and .NET Standard.

This package has no dependencies.

NuGet packages (31)

Showing the top 5 NuGet packages that depend on Shuttle.Core.Contract:

Package Downloads
Shuttle.Core.Logging The ID prefix of this package has been reserved for one of the owners of this package by NuGet.org.

Logging adapter.

Shuttle.Core.Reflection The ID prefix of this package has been reserved for one of the owners of this package by NuGet.org.

Reflection infrastructure components.

Shuttle.Core.Data The ID prefix of this package has been reserved for one of the owners of this package by NuGet.org.

Provides an abstraction over ADO.NET.

Shuttle.Core.Serialization The ID prefix of this package has been reserved for one of the owners of this package by NuGet.org.

Serialization adapter.

Shuttle.Core.Transactions The ID prefix of this package has been reserved for one of the owners of this package by NuGet.org.

Transaction adapter.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
11.0.0 1,498 12/1/2022
10.1.0 10,629 5/27/2022
10.0.4 186 5/21/2022
10.0.3 36,881 11/26/2020
10.0.2 9,026 2/13/2020
10.0.1 82,984 7/3/2018
10.0.0 44,943 12/27/2017