public virtual void SetProjectionExpression([NotNull] FieldExpression expression) { Check.NotNull(expression, nameof(expression)); ClearProjection(); AddToProjection(expression); }
public virtual int AddToProjection([NotNull] FieldExpression fieldExpression) { Check.NotNull(fieldExpression, nameof(fieldExpression)); var projectionIndex = _projection .FindIndex(ce => { return(ce?.Property == fieldExpression.Property && ce?.Type == fieldExpression.Type && ce.CollectionName == fieldExpression.CollectionName); }); if (projectionIndex == -1) { projectionIndex = _projection.Count; _projection.Add(fieldExpression); } return(projectionIndex); }
private bool Equals([NotNull] FieldExpression other) => ((_property == null && other._property == null) || (_property != null && _property.Equals(other._property))) && Type == other.Type && _collectionExpression.Equals(other._collectionExpression);