예제 #1
0
        public Criteria Or(string parameter, Clause clause, object value)
        {
            var criteriaItem = new CriteriaItem(LogicalOperator.Or, parameter, clause, value);

            _criteriaList.Add(criteriaItem);
            return(this);
        }
예제 #2
0
        public Criteria(string parameter, Clause clause, object value)
            : this()
        {
            var criteriaItem = new CriteriaItem(LogicalOperator.None, parameter, clause, value);

            _criteriaList.Add(criteriaItem);
        }
예제 #3
0
        public void Process(CriteriaItem criteriaItem, int nestingLevel, int index)
        {
            AppendLogicaloperator(criteriaItem.LogicalOperator);
            expression.Append(GetColumnName(criteriaItem));
            expression.Append(_SPACE);
            expression.Append(strClauses[criteriaItem.Clause]);
            switch (criteriaItem.Clause)
            {
            case Clause.IsNotNull:
                break;

            case Clause.IsNull:
                break;

            default:
                expression.Append(_SPACE);
                expression.Append(GetValue(criteriaItem, nestingLevel, index));
                break;
            }
        }
예제 #4
0
 protected virtual string GetValue(CriteriaItem criteriaItem, int nestingLevel, int index)
 {
     return(valueToStringConverter.Convert(criteriaItem.Value));
 }
예제 #5
0
 protected virtual string GetColumnName(CriteriaItem criteriaItem)
 {
     return(criteriaItem.Parameter);
 }