Exemple #1
0
 /// <summary>
 /// Appends a filter with an OR operation.
 /// </summary>
 /// <param name="filter">The filter to append.</param>
 /// <returns>The T.</returns>
 public ClassSelect <T> Or(ClassFilter filter)
 {
     if (this._WhereFirst == null)
     {
         this._WhereFirst = new ClassFilterNode(filter);
         this._WhereLast  = this._WhereFirst;
     }
     else
     {
         this._WhereLast = this._WhereLast.SetNext(FilterOperation.Or, filter);
     }
     return(this);
 }
Exemple #2
0
        public virtual void AppendFilterNodes(StringBuilder builder, DataAspect aspect, ClassFilterNode node)
        {
            AppendFilter(builder, aspect, node.Filter);
            if (node.Next != null)
            {
                switch (node.Operation)
                {
                case FilterOperation.And:
                    builder.Append(" AND ");
                    break;

                case FilterOperation.Or:
                    builder.Append(" OR ");
                    break;

                default:
                    throw new ArgumentException("Unknown filter operation " + node.Operation, "node");
                }

                AppendFilterNodes(builder, aspect, node.Next);
            }
        }
Exemple #3
0
 /// <summary>
 /// Sets the next node.
 /// </summary>
 /// <param name="operation">The operation to join the nodes.</param>
 /// <param name="filter">The filter of the next node.</param>
 /// <returns>The next node.</returns>
 public ClassFilterNode SetNext(FilterOperation operation, ClassFilter filter)
 {
     this._Operation = operation;
     this._Next      = new ClassFilterNode(filter);
     return(this._Next);
 }
 /// <summary>
 /// Creates a new filter expression with a single filter node.
 /// </summary>
 /// <param name="filter">The filter.</param>
 public ClassFilterExpression(ClassFilter filter)
 {
     this._Aspect = filter.Aspect;
     this._first  = new ClassFilterNode(filter);
     this._last   = this._first;
 }
 /// <summary>
 /// Appends a filter with an OR operation.
 /// </summary>
 /// <param name="filter">The filter to append.</param>
 /// <returns>The ClassFilterExpression.</returns>
 public ClassFilterExpression Or(ClassFilter filter)
 {
     this._last = this._last.SetNext(FilterOperation.Or, filter);
     return(this);
 }
Exemple #6
0
 /// <summary>
 /// Sets the given fiter as the only filter node.
 /// </summary>
 /// <param name="filter">The filter to set to the first filter node.</param>
 /// <returns>The ClassSelect of TEntity</returns>
 public ClassSelect <T> Where(ClassFilter filter)
 {
     this._WhereFirst = new ClassFilterNode(filter);
     this._WhereLast  = this._WhereFirst;
     return(this);
 }
 /// <summary>
 /// Appends a filter with an OR operation.
 /// </summary>
 /// <param name="filter">The filter to append.</param>
 /// <returns>The T.</returns>
 public ClassDelete Or(ClassFilter filter)
 {
     this._WhereLast = this._WhereLast.SetNext(FilterOperation.Or, filter);
     return(this);
 }
 // <summary>
 /// Appends a filter with an AND operation.
 /// </summary>
 /// <param name="filter">The filter to append.</param>
 /// <returns>The T.</returns>
 public EnumerableSelect <T> And(ClassFilter filter)
 {
     this._WhereLast = this._WhereLast.SetNext(FilterOperation.And, filter);
     return(this);
 }
Exemple #9
0
 // <summary>
 /// Appends a filter with an AND operation.
 /// </summary>
 /// <param name="filter">The filter to append.</param>
 /// <returns>The T.</returns>
 public ClassSelectMember And(ClassFilter filter)
 {
     this._WhereLast = this._WhereLast.SetNext(FilterOperation.And, filter);
     return(this);
 }
Exemple #10
0
 /// <summary>
 /// Sets the given fiter as the only filter node.
 /// </summary>
 /// <param name="filter">The filter to set to the first filter node.</param>
 /// <returns>The ClassSelect of TEntity</returns>
 public ClassUpdate Where(ClassFilter filter)
 {
     this._WhereFirst = new ClassFilterNode(filter);
     this._WhereLast  = this._WhereFirst;
     return(this);
 }
Exemple #11
0
 // <summary>
 /// Appends a filter with an AND operation.
 /// </summary>
 /// <param name="filter">The filter to append.</param>
 /// <returns>The T.</returns>
 public ClassUpdate And(ClassFilter filter)
 {
     this._WhereLast = this._WhereLast.SetNext(FilterOperation.And, filter);
     return(this);
 }