add utility extension to work with types

This commit is contained in:
ig 2023-05-04 09:40:34 +02:00
parent 2ec5b34971
commit e869c1e2fc
1 changed files with 7 additions and 0 deletions

View File

@ -0,0 +1,7 @@
namespace InnovEnergy.Lib.Utils;
public static class Types
{
public static Boolean Extends<T>(this Type type) => type.IsAssignableTo(typeof(T));
public static Boolean Is<T>(this Type type) => type == typeof(T);
}