Fluent API for Null checks.
$ dotnet add package MotzArt.NullChecksExtension methods for Fluent null checks.
Features:
Nullable<T> struct that return not nullable value.null.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."
Use EnsureArgumentNotNull extension method to check method's arguments for null.
var fs = File.Open(fileName.EnsureArgumentNotNull());
Use EnsureNotEmpty to check if collection is not null and not empty.
var firstArg = args.EnsureNotEmpty()[0];