Browse Source

Added checker for Struct types

pull/12602/head
j0nimost 4 years ago
parent
commit
8f498eb590
  1. 13
      framework/src/Volo.Abp.Core/Volo/Abp/Check.cs

13
framework/src/Volo.Abp.Core/Volo/Abp/Check.cs

@ -162,4 +162,17 @@ public static class Check
return value;
}
public static T NotDefault<T>(
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;
}
}

Loading…
Cancel
Save