MotzArt.NullChecks
1.0.0
See the version list below for details.
dotnet add package MotzArt.NullChecks --version 1.0.0
NuGet\Install-Package MotzArt.NullChecks -Version 1.0.0
<PackageReference Include="MotzArt.NullChecks" Version="1.0.0" />
<PackageVersion Include="MotzArt.NullChecks" Version="1.0.0" />
<PackageReference Include="MotzArt.NullChecks" />
paket add MotzArt.NullChecks --version 1.0.0
#r "nuget: MotzArt.NullChecks, 1.0.0"
#:package MotzArt.NullChecks@1.0.0
#addin nuget:?package=MotzArt.NullChecks&version=1.0.0
#tool nuget:?package=MotzArt.NullChecks&version=1.0.0
MotzArt NullChecks
Extension methods for Fluent null checks.
Features:
- Fluent methods.
- All null check methods has overloads for
Nullable<T>struct that return not nullable value. - All methods are fully anotated with C# nullability attributes.
- All methods capture expression that is checked for
null.
EnsureNotNull
Use EnsureNotNull extension method to check any expression for null right inside an expression:
var fs = File.Open(fileName.EnsureNotNull());
If fileName is null a NullReferenceExcption will be thrown with message "fileName should not be null."
EnsureArgumentNotNull
Use EnsureArgumentNotNull extension method to check method's arguments for null.
var fs = File.Open(fileName.EnsureArgumentNotNull());
EnsureNotEmpty
Use EnsureNotEmpty to check if collection is not null and not empty.
var firstArg = args.EnsureNotEmpty()[0];
| 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. |
-
net8.0
- No dependencies.
NuGet packages (1)
Showing the top 1 NuGet packages that depend on MotzArt.NullChecks:
| Package | Downloads |
|---|---|
|
MotzArt.FluentAssertions
Fluent assertion library for NUnit that provides intuitive, chainable assertion methods designed for static null analysis. |
GitHub repositories
This package is not used by any popular GitHub repositories.