Exemplo n.º 1
0
        public static ProjectionDefinition <TDocument> CreateMongoProjection(Action <IDocumentProjectionBuilder> projection)
        {
            var builder = new MongoDocumentProjectionBuilder <TDocument>();

            projection?.Invoke(builder);

            return((builder._projections.Count != 1) ? InternalBuilder.Combine(builder._projections) : builder._projections[0]);
        }
        public IDocumentFindCursor Project(Action <IDocumentProjectionBuilder> projection)
        {
            _projection = MongoDocumentProjectionBuilder <DynamicWrapper> .CreateMongoProjection(projection);

            return(this);
        }