Shuttle.Core.Contract
20.0.1
Prefix Reserved
See the version list below for details.
dotnet add package Shuttle.Core.Contract --version 20.0.1
NuGet\Install-Package Shuttle.Core.Contract -Version 20.0.1
<PackageReference Include="Shuttle.Core.Contract" Version="20.0.1" />
<PackageVersion Include="Shuttle.Core.Contract" Version="20.0.1" />
<PackageReference Include="Shuttle.Core.Contract" />
paket add Shuttle.Core.Contract --version 20.0.1
#r "nuget: Shuttle.Core.Contract, 20.0.1"
#:package Shuttle.Core.Contract@20.0.1
#addin nuget:?package=Shuttle.Core.Contract&version=20.0.1
#tool nuget:?package=Shuttle.Core.Contract&version=20.0.1
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.
string AgainstEmpty(string? value, [CallerArgumentExpression("value")] string? name = null)
Throws a ArgumentNullException if the given value is null or empty/whitespace; else returns the value.
Guid AgainstEmpty(Guid value, [CallerArgumentExpression("value")] string? name = null)
Throws and ArgumentException when the value is equal to an empty Guid ({00000000-0000-0000-0000-000000000000}); else returns the value.
IEnumerable<T> AgainstEmpty<T>(IEnumerable<T> enumerable, [CallerArgumentExpression("enumerable")] string? name = null)
Throws an ArgumentException if the given enumerable does not contain any entries; else returns the enumerable.
T AgainstNull<T>(T? value, [CallerArgumentExpression("value")] string? name = null)
Throws a ArgumentNullException if the given value is null; else returns the value.
TEnum AgainstUndefinedEnum<TEnum>(object? value, [CallerArgumentExpression("value")] string? name = null)
Throws an InvalidOperationException if the provided value cannot be found in the given TEnum; else returns the value as TEnum.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net8.0 is compatible. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. net9.0 was computed. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 was computed. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
This package has no dependencies.
NuGet packages (38)
Showing the top 5 NuGet packages that depend on Shuttle.Core.Contract:
| Package | Downloads |
|---|---|
|
Shuttle.Esb
Contains the core Shuttle.Esb assembly that should always be referenced when building Shuttle.Esb solutions. |
|
|
Shuttle.Core.Reflection
Reflection infrastructure components. |
|
|
Shuttle.Core.Logging
Logging adapter. |
|
|
Shuttle.Core.Specification
Simple specification mechanism. |
|
|
Shuttle.Core.Threading
Thread-based processing. |
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 21.0.0-alpha | 30 | 1/9/2026 |
| 20.0.1 | 2,965 | 5/6/2025 |
| 20.0.0 | 17,777 | 2/2/2025 |
| 11.1.1 | 2,736 | 7/21/2024 |
| 11.1.0 | 8,074 | 4/30/2024 |
| 11.0.0 | 29,707 | 12/1/2022 |
| 10.1.0 | 42,402 | 5/27/2022 |
| 10.0.4 | 1,144 | 5/21/2022 |
| 10.0.3 | 105,885 | 11/26/2020 |
| 10.0.2 | 32,489 | 2/13/2020 |
| 10.0.1 | 157,372 | 7/3/2018 |
| 10.0.0 | 98,146 | 12/27/2017 |