src/Shared/EntityFramework.Community.Shared/EntityFrameworkManager/EntityFrameworkManager.cs
/// <summary>Query if 'parentClass' is assignable from.</summary>
/// <param name="parentClass">The parent class.</param>
/// <param name="baseClass">The base class.</param>
/// <returns>True if assignable from, false if not.</returns>
Query if 'parentClass' is assignable from.
Query if ' parentClass ' is assignable from .
public static bool IsAssignableFrom(Type parentClass, Type baseClass)
        {
            ConcurrentDictionary<Type, bool> assignableFromDict;
            if (!IsAssignableFromDict.TryGetValue(parentClass, out assignableFromDict)){
                assignableFromDict = IsAssignableFromDict[parentClass] = new ConcurrentDictionary<Type, bool>();
            }
            bool isAssignable;
            if (!assignableFromDict.TryGetValue(baseClass, out isAssignable))
            {
                isAssignable = baseClass.IsAssignableFrom(parentClass);
                assignableFromDict[baseClass] = isAssignable;
            }
            return isAssignable;
        }
public static bool IsAssignableFrom ( Type parentClass , Type baseClass ) { ConcurrentDictionary < Type , bool > assignableFromDict ; if ( ! IsAssignableFromDict . TryGetValue ( parentClass , out assignableFromDict ) ) { assignableFromDict = IsAssignableFromDict [ parentClass ] = new ConcurrentDictionary < Type , bool > ( ) ; } bool isAssignable ; if ( ! assignableFromDict . TryGetValue ( baseClass , out isAssignable ) ) { isAssignable = baseClass . IsAssignableFrom ( parentClass ) ; assignableFromDict [ baseClass ] = isAssignable ; } return isAssignable ; }
Query if 'parentClass' is assignable from.
Query if ' parentClass ' is assignable from .
// TODO: ZZZ - Need some rework!
True if assignable from, false if not.
True if assignable from false if not .
parentClass
Type
The parent class.
The parent class .
baseClass
Type
The base class.
The base class .