diff --git a/framework/src/Volo.Abp.Core/Volo/Abp/Check.cs b/framework/src/Volo.Abp.Core/Volo/Abp/Check.cs index d4361875ec..01ffc8c55b 100644 --- a/framework/src/Volo.Abp.Core/Volo/Abp/Check.cs +++ b/framework/src/Volo.Abp.Core/Volo/Abp/Check.cs @@ -163,18 +163,7 @@ public static class Check return value; } - public static T NotDefault( - T value, - [InvokerParameterName][NotNull] string parameterName) - where T : struct - { - if(value.Equals(default(T))) - { - throw new ArgumentException($"{parameterName} has a default value or is empty!", parameterName); - } - return value; - } public static Int16 Positive( Int16 value, @@ -319,6 +308,10 @@ public static class Check if (value < minimumValue || value > maximumValue) { throw new ArgumentException($"{parameterName} is out of range min: {minimumValue} - max: {maximumValue}"); + } + return value; + } + public static double Range( double value, @@ -349,4 +342,17 @@ public static class Check return value; } + public static T NotDefault( + T value, + [InvokerParameterName][NotNull] string parameterName) + where T : struct + { + if(value.Equals(default(T))) + { + throw new ArgumentException($"{parameterName} has a default value or is empty!", parameterName); + } + + return value; + } + }