Exemple #1
0
        public PipelineExpression(Expression source, SerializationExpression projector, ResultOperator resultOperator)
        {
            _source         = Ensure.IsNotNull(source, nameof(source));
            _projector      = Ensure.IsNotNull(projector, nameof(projector));
            _resultOperator = resultOperator;

            if (_resultOperator == null)
            {
                _serializer = SerializerHelper.CreateEnumerableSerializer(_projector.Serializer);
                _type       = typeof(IEnumerable <>).MakeGenericType(_projector.Type);
            }
            else
            {
                _serializer = _resultOperator.Serializer;
                _type       = _resultOperator.Type;
            }
        }
 public CollectionExpression(CollectionNamespace collectionNamespace, IBsonSerializer itemSerializer)
 {
     _collectionNamespace = Ensure.IsNotNull(collectionNamespace, nameof(collectionNamespace));
     _serializer          = SerializerHelper.CreateEnumerableSerializer(Ensure.IsNotNull(itemSerializer, nameof(itemSerializer)));
 }