Skip to content

Provides a set of backward compatible `throw` helper methods, which have been added in previous .NET versions.

License

Notifications You must be signed in to change notification settings

dailydevops/arguments

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

42 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

NetEvolve.Arguments

Provides a set of backward compatible argument throw helper methods added in the latest .NET versions. Especially intended for projects with multiple TargetFrameworks, for usage, standardization and maintainability.

Method Overview

The following methods are currently provided.

ThrowIfGreaterThan

Compatibility method to ArgumentOutOfRangeException.ThrowIfGreaterThan<T>(T, T, String), which was introduced with .NET 8

ThrowIfGreaterThanOrEqual

Compatibility method to ArgumentOutOfRangeException.ThrowIfGreaterThanOrEqual<T>(T, T, String), which is part of the framework since .NET 8.

ThrowIfLessThan

Compatibility method to ArgumentOutOfRangeException.ThrowIfLessThan<T>(T, T, String), which is part of the framework since .NET 8.

ThrowIfLessThanOrEqual

Compatibility method to ArgumentOutOfRangeException.ThrowIfLessThanOrEqual<T>(T, T, String), which is part of the framework since .NET 8.

ThrowIfNull

Compatibility method to ArgumentNullException.ThrowIfNull(Object, String), which is part of the framework since .NET 8.

ThrowIfNullOrEmpty

Compatibility method to ArgumentException.ThrowIfNullOrEmpty(String, String), which is part of the framework since .NET 8.

ThrowIfNullOrWhiteSpace

Compatibility method to ArgumentException.ThrowIfNullOrWhiteSpace(String, String), which is part of the framework since .NET 8.