|
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using HealthMonitor.Util.Entities.Base;
- using HealthMonitor.Util.Entities.Interfaces;
-
- namespace HealthMonitor.Util.Common
- {
- public class EntityUtils
- {
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- public static bool HasAutoGenerateKey(Type type)
- {
- var ifs = type.GetInterfaces();
- var numericTypes = new List<Type> { typeof(IKeyIntType), typeof(IKeyLongType) };
- var manualTypes = new List<Type> { typeof(IKeyIntNeverGeneratedType), typeof(IKeyLongNeverGeneratedType) };
-
- if(ifs.Any(e => numericTypes.Contains(e)) && ifs.Any(e => manualTypes.Contains(e)) == false)
- {
- return true;
- }
- return false;
- }
- }
- }
|