public virtual int AddToProjection(FieldExpression 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);
        }
 public virtual void SetProjectionExpression(FieldExpression expression)
 {
     ClearProjection();
     AddToProjection(expression);
 }
Esempio n. 3
0
 private bool Equals(FieldExpression other)
 => ((_property == null && other._property == null) ||
     (_property != null && _property.Equals(other._property))) &&
 Type == other.Type &&
 _collectionExpression.Equals(other._collectionExpression);