Description (optional)
.NET5 introduced the handy IsAssignableTo(Type) Method
Rationale
new code is using this and for backword compatibility the code has to be rewritten or an own extensions method needs to be manually added.
Proposed API
namespace System;
#if !NET5_0_OR_GREATER
internal static class Extensions
{
public static bool IsAssignableTo(this Type sourceType, Type? targetType) => targetType?.IsAssignableFrom(sourceType) ?? false;
}
#endif
Drawbacks
n.a.
Alternatives
Adding the extension method from above manually.
Other thoughts
n.a.
Description (optional)
.NET5 introduced the handy
IsAssignableTo(Type)MethodRationale
new code is using this and for backword compatibility the code has to be rewritten or an own extensions method needs to be manually added.
Proposed API
Drawbacks
n.a.
Alternatives
Adding the extension method from above manually.
Other thoughts
n.a.