public IOperand CreateFieldRefOperandWithOrdering(XElement el, Camlex.OrderDirection orderDirection) { var fieldRefOperand = this.CreateFieldRefOperand(el) as FieldRefOperand; if (fieldRefOperand == null) { throw new CamlAnalysisException( string.Format( "Can't create field ref operand with ordering: underlying field ref operand is null. Xml which causes issue:\n{0}", el)); } return(new FieldRefOperandWithOrdering(fieldRefOperand, orderDirection)); }
// just in order to avoid compiler error that base type doesn't contain parameterless constructor public FieldRefOperandWithOrdering(FieldRefOperand fieldRefOperand, Camlex.OrderDirection orderDirection) : base(string.Empty) { if (fieldRefOperand.FieldId != null) { this.initialize(fieldRefOperand.FieldId.Value); } else if (!string.IsNullOrEmpty(fieldRefOperand.FieldName)) { this.initialize(fieldRefOperand.FieldName); } else { throw new FieldRefOperandShouldContainNameOrIdException(); } this.orderDirection = orderDirection; }
public FieldRefOperandWithOrdering(FieldRefOperand fieldRefOperand, Camlex.OrderDirection orderDirection) : base(string.Empty) // just in order to avoid compiler error that base type doesn't contain parameterless constructor { if (fieldRefOperand.FieldId != null) { this.initialize(fieldRefOperand.FieldId.Value); } else if (!string.IsNullOrEmpty(fieldRefOperand.FieldName)) { this.initialize(fieldRefOperand.FieldName); } else { throw new FieldRefOperandShouldContainNameOrIdException(); } this.orderDirection = orderDirection; }
public IOperand CreateFieldRefOperandWithOrdering(Expression expr, Camlex.OrderDirection orderDirection) { var fieldRefOperand = (FieldRefOperand)CreateFieldRefOperand(expr, null); return(new FieldRefOperandWithOrdering(fieldRefOperand, orderDirection)); }