|
@@ -13,7 +13,6 @@ using System.Net.Mail;
|
|
using System.Reflection;
|
|
using System.Reflection;
|
|
using System.Text;
|
|
using System.Text;
|
|
using System.Text.RegularExpressions;
|
|
using System.Text.RegularExpressions;
|
|
-using System.Diagnostics.CodeAnalysis;
|
|
|
|
using Newtonsoft.Json;
|
|
using Newtonsoft.Json;
|
|
using Newtonsoft.Json.Linq;
|
|
using Newtonsoft.Json.Linq;
|
|
using System.Runtime.CompilerServices;
|
|
using System.Runtime.CompilerServices;
|
|
@@ -277,6 +276,8 @@ namespace InABox.Core
|
|
return result;
|
|
return result;
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ #region Reflection
|
|
|
|
+
|
|
public static bool HasInterface(this Type type, Type interfaceType)
|
|
public static bool HasInterface(this Type type, Type interfaceType)
|
|
{
|
|
{
|
|
return type.GetInterfaces(interfaceType).Any();
|
|
return type.GetInterfaces(interfaceType).Any();
|
|
@@ -332,6 +333,9 @@ namespace InABox.Core
|
|
|
|
|
|
return null;
|
|
return null;
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+ #endregion
|
|
|
|
+
|
|
public static bool TryGetEntity(string entityname, [NotNullWhen(true)] out Type? type)
|
|
public static bool TryGetEntity(string entityname, [NotNullWhen(true)] out Type? type)
|
|
{
|
|
{
|
|
if (string.IsNullOrWhiteSpace(entityname))
|
|
if (string.IsNullOrWhiteSpace(entityname))
|