thedmi / MiniGuard

A minimalistic guard library for .NET with Resharper contract annotations
MIT License
1 stars 1 forks source link

MiniGuard

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.