System.Linq.Expressions.Error.CoercionOperatorNotDefined C# (CSharp) Метод

CoercionOperatorNotDefined() статический приватный Метод

InvalidOperationException with message like "No coercion operator is defined between types '{0}' and '{1}'."
static private CoercionOperatorNotDefined ( object p0, object p1 ) : Exception
p0 object
p1 object
Результат System.Exception
        internal static Exception CoercionOperatorNotDefined(object p0, object p1)
        {
            return new InvalidOperationException(Strings.CoercionOperatorNotDefined(p0, p1));
        }
        /// <summary>

Usage Example

Пример #1
0
        //CONFORMING
        private static UnaryExpression GetUserDefinedCoercionOrThrow(ExpressionType coercionType, Expression expression, Type convertToType)
        {
            UnaryExpression u = GetUserDefinedCoercion(coercionType, expression, convertToType);

            if (u != null)
            {
                return(u);
            }
            throw Error.CoercionOperatorNotDefined(expression.Type, convertToType);
        }
Error