public void RemoveOrderByField(string field) { if (_orderByField != null) { if (_orderByField is CompoundField) { CompoundField obf = (CompoundField)_orderByField; obf.RemoveField(field); } else { _orderByField = null; } } }
public void RemoveGroupByField(string field) { if (_groupByField != null) { if (_groupByField is CompoundField) { CompoundField gbf = (CompoundField)_groupByField; gbf.RemoveField(field); } else { _groupByField = null; } } }
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; } }
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; } }
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)); } } }