feat: Type IsAssignableTo extension shim

This commit is contained in:
Chris Cameron
2019-02-19 14:32:32 -05:00
parent fa124a0afc
commit 4a330637a7

View File

@@ -162,6 +162,19 @@ namespace ICD.Common.Utils.Extensions
.Assembly;
}
/// <summary>
/// Returns true if the type is assignable to the given type.
/// </summary>
/// <param name="from"></param>
/// <returns></returns>
public static bool IsAssignableTo<T>(this Type from)
{
if (from == null)
throw new ArgumentNullException("from");
return from.IsAssignableTo(typeof(T));
}
/// <summary>
/// Returns true if the type is assignable to the given type.
/// </summary>