Browse Source

Added Check.AssignableTo

pull/3401/head
Halil İbrahim Kalkan 7 years ago
parent
commit
0053c02946
  1. 15
      framework/src/Volo.Abp.Core/Volo/Abp/Check.cs

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

@ -121,6 +121,21 @@ namespace Volo.Abp
return value;
}
[ContractAnnotation("type:null => halt")]
public static Type AssignableTo<TBaseType>(
Type type,
[InvokerParameterName] [NotNull] string parameterName)
{
NotNull(type, parameterName);
if (!type.IsAssignableTo<TBaseType>())
{
throw new ArgumentException($"{parameterName} should be assignable to the {typeof(TBaseType).GetFullNameWithAssemblyName()}!");
}
return type;
}
public static string Length(
[CanBeNull] string value,
[InvokerParameterName] [NotNull] string parameterName,

Loading…
Cancel
Save