Пример #1
0
 public void AddOrderByField(IEvaluable field, SortOrder order)
 {
     if (_orderByField == null)
     {
         _orderByField = new Field(field, Field.FieldType.Ordered, order);
     }
     else if (_orderByField is CompoundField)
     {
         CompoundField obf = (CompoundField)_orderByField;
         obf.AddField(new Field(field, Field.FieldType.Ordered, order));
     }
     else
     {
         CompoundField obf = new CompoundField(Field.FieldType.Ordered);
         obf.AddField(_orderByField);
         obf.AddField(new Field(field, Field.FieldType.Ordered, order));
         _orderByField = obf;
     }
 }
Пример #2
0
 public void AddGroupByField(IEvaluable field)
 {
     if (_groupByField == null)
     {
         _groupByField = new Field(field, Field.FieldType.Grouped);
     }
     else if (_groupByField is CompoundField)
     {
         CompoundField gbf = (CompoundField)_groupByField;
         gbf.AddField(new Field(field, Field.FieldType.Grouped));
     }
     else
     {
         CompoundField gbf = new CompoundField(Field.FieldType.Grouped);
         gbf.AddField(_groupByField);
         gbf.AddField(new Field(field, Field.FieldType.Grouped));
         _groupByField = gbf;
     }
 }
Пример #3
0
 public void AddDistinctField(IEvaluable projection)
 {
     if (_distinctField == null)
     {
         _distinctField = new Field(projection, Field.FieldType.Distinct);
     }
     else
     {
         var compoundField = _distinctField as CompoundField;
         if (compoundField != null)
         {
             compoundField.AddField(new Field(projection, Field.FieldType.Distinct));
         }
         else
         {
             CompoundField field = new CompoundField(Field.FieldType.Distinct);
             field.AddField(_distinctField);
             field.AddField(new Field(projection, Field.FieldType.Distinct));
         }
     }
 }