From e869c1e2fc72c33f89498a26b301b2ad1417d59a Mon Sep 17 00:00:00 2001 From: ig Date: Thu, 4 May 2023 09:40:34 +0200 Subject: [PATCH] add utility extension to work with types --- csharp/Lib/Utils/Types.cs | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 csharp/Lib/Utils/Types.cs diff --git a/csharp/Lib/Utils/Types.cs b/csharp/Lib/Utils/Types.cs new file mode 100644 index 000000000..5eeb40069 --- /dev/null +++ b/csharp/Lib/Utils/Types.cs @@ -0,0 +1,7 @@ +namespace InnovEnergy.Lib.Utils; + +public static class Types +{ + public static Boolean Extends(this Type type) => type.IsAssignableTo(typeof(T)); + public static Boolean Is(this Type type) => type == typeof(T); +} \ No newline at end of file