System.Data.Entity.Core.Objects.ELinq.ExpressionConverter.GetIsOrAsTargetType C# (CSharp) Метод

GetIsOrAsTargetType() приватный Метод

Gets the target type for an Is or As expression.
private GetIsOrAsTargetType ( ExpressionType operationType, Type toClrType, Type fromClrType ) : TypeUsage
operationType ExpressionType Type of operation; used in error reporting.
toClrType Type Test or return type.
fromClrType Type Input type in CLR metadata.
Результат TypeUsage
        private TypeUsage GetIsOrAsTargetType(ExpressionType operationType, Type toClrType, Type fromClrType)
        {
            Debug.Assert(operationType == ExpressionType.TypeAs || operationType == ExpressionType.TypeIs);

            // Interpret all type information
            TypeUsage toType;
            if (!TryGetValueLayerType(toClrType, out toType)
                ||
                (!TypeSemantics.IsEntityType(toType) &&
                 !TypeSemantics.IsComplexType(toType)))
            {
                throw new NotSupportedException(
                    Strings.ELinq_UnsupportedIsOrAs(
                        operationType,
                        DescribeClrType(fromClrType), DescribeClrType(toClrType)));
            }

            return toType;
        }