Ejemplo n.º 1
0
        protected Predicate(string name, T value, Operator op, PredSpecialType specialOp = PredSpecialType.None)
        {
            Type tp = value.GetType();

            if (tp != typeof(int) && tp != typeof(long) && tp != typeof(byte) && tp != typeof(short) && tp != typeof(string) && tp != typeof(DateTime) && tp != typeof(float) && tp != typeof(decimal))
            {
                throw new Exception(string.Format("{0} Type is not supported to create a predicate", tp));
            }

            _name      = name;
            _value     = value;
            _operator  = op;
            _specialTp = specialOp;
        }
Ejemplo n.º 2
0
        public static IPredicate GetPredicate(string name, T value, Operator op, PredSpecialType type = PredSpecialType.None)
        {
            IPredicate pred = new Predicate <T>(name, value, op, type);

            return(pred);
        }