oehen.arguard
2.5.1
.NET 5.0
This package targets .NET 5.0. The package is compatible with this framework or higher.
.NET Core 3.1
This package targets .NET Core 3.1. The package is compatible with this framework or higher.
.NET Standard 2.0
This package targets .NET Standard 2.0. The package is compatible with this framework or higher.
There is a newer version of this package available.
See the version list below for details.
See the version list below for details.
dotnet add package oehen.arguard --version 2.5.1
NuGet\Install-Package oehen.arguard -Version 2.5.1
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="oehen.arguard" Version="2.5.1" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add oehen.arguard --version 2.5.1
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: oehen.arguard, 2.5.1"
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install oehen.arguard as a Cake Addin #addin nuget:?package=oehen.arguard&version=2.5.1 // Install oehen.arguard as a Cake Tool #tool nuget:?package=oehen.arguard&version=2.5.1
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
oehen.arguard
oehen.arguard is a dotnet argument and parameter validator extension library.
Installation
Use the nuget package manager to install oehen.arguard:
Package oehen.arguard is publish to nuget.org.
dotnet add package oehen.arguard --version <VERSION>
Usage
Usage in a constructor
This example shows a solution to check constructor parameter and assign them to local fields in one line.
public class ClassA
{
private readonly string _text;
private readonly int _number;
public ClassA(string name, int number)
{
// name should not be null or whitespace
_text_ = text.ThrowIfIsNullOrWhiteSpace(nameof(text));
// number should be greater than zero
_number = number.ThrowIfIsLessThanZero(nameof(number));
// ...
}
}
Usage in a method
This example shows a solution to check the parameter of a public method.
public void DoSomethingWithThisApple(Apple apple)
{
apple.ThrowIfNull(nameof(apple));
// ...
}
Documentation
The latest documentation can find at https://eoehen.github.io/arguard/.
License
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net5.0 is compatible. net5.0-windows was computed. net6.0 is compatible. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 was computed. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 was computed. 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. |
.NET Core | netcoreapp2.0 was computed. netcoreapp2.1 was computed. netcoreapp2.2 was computed. netcoreapp3.0 was computed. netcoreapp3.1 is compatible. |
.NET Standard | netstandard2.0 is compatible. netstandard2.1 was computed. |
.NET Framework | net461 was computed. net462 was computed. net463 was computed. net47 was computed. net471 was computed. net472 was computed. net48 was computed. net481 was computed. |
MonoAndroid | monoandroid was computed. |
MonoMac | monomac was computed. |
MonoTouch | monotouch was computed. |
Tizen | tizen40 was computed. tizen60 was computed. |
Xamarin.iOS | xamarinios was computed. |
Xamarin.Mac | xamarinmac was computed. |
Xamarin.TVOS | xamarintvos was computed. |
Xamarin.WatchOS | xamarinwatchos was computed. |
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
-
.NETCoreApp 3.1
- No dependencies.
-
.NETStandard 2.0
- No dependencies.
-
net5.0
- No dependencies.
-
net6.0
- No dependencies.
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
Version | Downloads | Last updated |
---|---|---|
2.6.3 | 2,022 | 9/25/2024 |
2.6.2 | 2,638 | 6/4/2024 |
2.6.1 | 209 | 5/9/2024 |
2.6.0 | 231 | 3/8/2024 |
2.5.5 | 115 | 3/7/2024 |
2.5.4 | 116 | 3/7/2024 |
2.5.3 | 330 | 5/3/2023 |
2.5.2 | 384 | 12/23/2022 |
2.5.1 | 512 | 10/1/2022 |
2.5.0 | 476 | 10/1/2022 |
2.4.0 | 430 | 8/22/2022 |
2.3.0 | 441 | 8/11/2022 |
2.2.0 | 443 | 8/11/2022 |
2.1.0 | 495 | 5/4/2022 |
2.0.0 | 678 | 9/27/2021 |
1.0.1 | 485 | 8/1/2021 |
1.0.0 | 445 | 5/30/2021 |
0.12.0 | 402 | 5/30/2021 |
0.11.2 | 459 | 5/29/2021 |
0.11.1 | 397 | 5/28/2021 |
0.11.0 | 410 | 5/25/2021 |
0.9.2 | 658 | 2/18/2021 |
0.9.1 | 378 | 2/18/2021 |
0.9.0 | 417 | 1/22/2021 |
0.7.0 | 473 | 11/19/2020 |
0.5.0 | 521 | 11/1/2020 |
0.4.0 | 539 | 10/31/2020 |
0.3.11 | 532 | 9/6/2020 |
0.2.5 | 436 | 10/31/2020 |
0.2.2 | 488 | 10/31/2020 |