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

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

InvalidOperationException with message like "The unary operator {0} is not defined for the type '{1}'."
static private UnaryOperatorNotDefined ( object p0, object p1 ) : Exception
p0 object
p1 object
Результат Exception
        internal static Exception UnaryOperatorNotDefined(object p0, object p1)
        {
            return new InvalidOperationException(Strings.UnaryOperatorNotDefined(p0, p1));
        }
        /// <summary>

Usage Example

Пример #1
0
        //CONFORMING
        private static UnaryExpression GetUserDefinedUnaryOperatorOrThrow(ExpressionType unaryType, string name, Expression operand)
        {
            UnaryExpression u = GetUserDefinedUnaryOperator(unaryType, name, operand);

            if (u != null)
            {
                ValidateParamswithOperandsOrThrow(u.Method.GetParametersCached()[0].ParameterType, operand.Type, unaryType, name);
                return(u);
            }
            throw Error.UnaryOperatorNotDefined(unaryType, operand.Type);
        }
Error