CodeInsiders.SharpQL.Expression.GetConstant C# (CSharp) Method

GetConstant() public static method

public static GetConstant ( object value ) : Expression
value object
return Expression
        public static Expression GetConstant(object value)
        {
            if (value == null) {
                throw new ArgumentNullException("value");
            }

            Expression expr;
            if (TryGetConstant(value, out expr)) {
                return expr;
            }

            var message = String.Format(
                "Cannot convert value of type {0} to {1}",
                value.GetType(),
                typeof(ConstantExpression));
            throw new NotSupportedException(message);
        }