public bool Compare <TBaseType, TEnumCompareType>(TBaseType baseObject, ObjectComparatorCondition <TBaseType, TEnumCompareType> condition) where TEnumCompareType : Enum { foreach (var objectComparator in _objectComparators) { if (objectComparator.CanCompare(typeof(TBaseType), condition.CompareType.ToString())) { return(objectComparator.Compare(baseObject, condition.GetValue(), condition.CompareType.ToString())); } } throw new KeyNotFoundException($"There is no comparator with {typeof(TBaseType).Name} base type and {condition.CompareType} compare type"); }
public static bool IsNullOrEmpty <T1, T2>(this ObjectComparatorCondition <T1, T2> objectComparator) where T2 : Enum { return(objectComparator == null); }
public static bool IsNullOrEmpty <T>(this ObjectComparatorCondition <T> objectComparator) { return(objectComparator == null || objectComparator.CompareType.IsNullOrWhiteSpace()); }