Found 16 packages
Throw your exceptions easily.
An extensible argument validation package by @JarrydVanHoy that I feel reads quite fluently.
Extensions to the ArgumentException.ThrowIf methods to cover more scenarios and additional exception types. .Net provides a basic set of ThrowIf extension methods, and this library adds to that list.
A small helper library for .NET to throw if an argument does not meet specified criteria. Similar to contract programming or "Guard" classes but a bit more informative as to what it will do.
Basic, fluent guard clauses
SGuard is a lightweight guard library for .NET that offers explicit boolean checks (Is.*) and throwing guards (ThrowIf.*), a unified GuardCallback/GuardOutcome model, and richly-informative exceptions via CallerArgumentExpression for easier diagnostics. Targets net6.0/net7.0/net8.0/net9.0.
It is a helper library developed for PowFrame. If any object is null, throw ensures that it is thrown. It can also be used outside of PowFrame.
A universal polyfill library that provides modern ArgumentNullException.ThrowIf* and ArgumentException.ThrowIf* helper methods across all .NET runtimes (.NET Standard 2.0+, .NET Framework 4.6.2+, .NET 6.0+), enabling consistent argument validation patterns regardless of target framework version.
Inpired by CodeContracts, small piece of code that allows you to lower the ciclomatic complexity of code by removing some branching. Branching like most precondition, if - else - throw or if - else - set value.
Static classes for ASP.NET MVC to do some common operations. See the home please: https://github.com/AtaS/Mvc-Utilities
Contains polyfills from the mscorlib for .NET Framework 4.0. Add: System.Index System.HashCode System.Range System.Collections.Generic.IReadOnlySet System.Numerics.BitOperations System.Runtime.CompilerServices.DefaultInterpolatedStringHandler System.Runtime.CompilerServices.Unsafe System.Threading.Volatile Extensions: System.ArgumentExceptionEx: - ThrowIfNullOrEmpty - ThrowIfNullOrWhiteSpace System.ArgumentNullExceptionEx: - ThrowIfNull System.ArgumentOutOfRangeExceptionEx: - ThrowIfZero - ThrowIfNegative - ThrowIfNegativeOrZero - ThrowIfEqual - ThrowIfNotEqual - ThrowIfGreaterThan - ThrowIfGreaterThanOrEqual - ThrowIfLessThan - ThrowIfLessThanOrEqual System.ObjectDisposedExceptionEx: - ThrowIf System.OperatingSystemEx: - VersionString - IsOSPlatform - IsOSPlatformVersionAtLeast System.StringEx: - Create - Join - Split - Trim - TrimStart - TrimEnd - Contains - IndexOf - EndsWith - StartsWith System.Text.StringBuilderEx: - AppendInterpolatedStringHandler
Contains an extension method for a System.Object that checks whether it is null and in case it is, throws an ArgumentNullException, otherwise returns the same instance.
Contains polyfills from the mscorlib for .NET Framework 2.0 and .NET Framework 3.5. Add: System.Index System.IProgress System.HashCode System.Progress System.Range System.Collections.Generic.IReadOnlyCollection System.Collections.Generic.IReadOnlyDictionary System.Collections.Generic.IReadOnlyList System.Collections.Generic.IReadOnlySet System.Net.DnsEndPoint System.Numerics.BitOperations System.Runtime.CompilerServices.DefaultInterpolatedStringHandler System.Runtime.CompilerServices.Unsafe System.Threading.Volatile Extensions: System.ArgumentExceptionEx: - ThrowIfNullOrEmpty - ThrowIfNullOrWhiteSpace System.ArgumentNullExceptionEx: - ThrowIfNull System.ArgumentOutOfRangeExceptionEx: - ThrowIfZero - ThrowIfNegative - ThrowIfNegativeOrZero - ThrowIfEqual - ThrowIfNotEqual - ThrowIfGreaterThan - ThrowIfGreaterThanOrEqual - ThrowIfLessThan - ThrowIfLessThanOrEqual System.EnumEx: - TryParse<TEnum> System.EnvironmentEx: - Is64BitProcess - Is64BitOperatingSystem System.ObjectDisposedExceptionEx: - ThrowIf System.OperatingSystemEx: - VersionString - IsOSPlatform - IsOSPlatformVersionAtLeast System.RandomEx: - GetItems System.StringEx: - Create - Concat - IsNullOrWhiteSpace - Join - Split - Trim - TrimStart - TrimEnd - Contains - IndexOf - EndsWith - StartsWith System.Text.StringBuilderEx: - Clear - AppendInterpolatedStringHandler
Contains an extension method for System.String that checks whether it is null or empty and in case it is, throws an ArgumentNullException, otherwise returns the same instance.
Contains an extension method for System.String that checks whether it is null, empty or white-space and in case it is, throws an ArgumentNullException, otherwise returns the same instance.
Contains polyfills from the mscorlib for .NET Framework 3.5. Add: System.IProgress System.Progress System.Collections.Generic System.Collections.Generic.IReadOnlyCollection System.Collections.Generic.IReadOnlyDictionary System.Collections.Generic.IReadOnlyList System.Collections.Generic.IReadOnlySet System.Net.DnsEndPoint System.Threading.SpinWait System.Threading.Volatile Extensions: System.ArgumentNullExceptionEx: - ThrowIfNull System.EventHandlerEx: - EventHandlerEx<TEventArgs> System.StringEx: - Join<T> - IsNullOrWhiteSpace System.EnumEx: - TryParse<TEnum> System.EnvironmentEx: - Is64BitProcess - Is64BitOperatingSystem System.OperatingSystemEx: - VersionString - IsOSPlatform - IsOSPlatformVersionAtLeast System.Text.StringBuilderEx: - Clear