This library provides the simplest conceivable form of guards. They exist in the form of precondition, postcondition, and generic guard functions that take a boolean and an optional violation message.
All guard functions are annotated with Jetbrains [ContractAnnotation]
so that Resharper/Rider control flow analysis can make proper deductions.
Grab the NuGet here.