Пример #1
0
        public static bool IsStrictlyDerivedFrom([NotNull] this IReadOnlyEntityType entityType, [NotNull] IReadOnlyEntityType baseType)
        {
            Check.NotNull(entityType, nameof(entityType));
            Check.NotNull(baseType, nameof(baseType));

            return(entityType == baseType ? false : baseType.IsAssignableFrom(entityType));
        }
Пример #2
0
        public static IReadOnlyEntityType?LeastDerivedType([NotNull] this IReadOnlyEntityType entityType, [NotNull] IReadOnlyEntityType otherEntityType)
        {
            Check.NotNull(entityType, nameof(entityType));
            Check.NotNull(otherEntityType, nameof(otherEntityType));

            return(entityType.IsAssignableFrom(otherEntityType)
                ? entityType
                : otherEntityType.IsAssignableFrom(entityType)
                    ? otherEntityType
                    : null);
        }