File tree Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -47,10 +47,14 @@ public static IAggregateFluent<TDocument> Aggregate<TDocument>(this IMongoCollec
4747 /// </summary>
4848 /// <typeparam name="TDocument">The type of the document.</typeparam>
4949 /// <param name="collection">The collection.</param>
50+ /// <param name="aggregateOptions">The aggregate options</param>
5051 /// <returns>A queryable source of documents.</returns>
51- public static IMongoQueryable < TDocument > AsQueryable < TDocument > ( this IMongoCollection < TDocument > collection )
52+ public static IMongoQueryable < TDocument > AsQueryable < TDocument > ( this IMongoCollection < TDocument > collection , AggregateOptions aggregateOptions = null )
5253 {
53- var provider = new MongoQueryProviderImpl < TDocument > ( collection , new AggregateOptions ( ) ) ;
54+ Ensure . IsNotNull ( collection , nameof ( collection ) ) ;
55+
56+ aggregateOptions = aggregateOptions ?? new AggregateOptions ( ) ;
57+ var provider = new MongoQueryProviderImpl < TDocument > ( collection , aggregateOptions ) ;
5458 return new MongoQueryableImpl < TDocument , TDocument > ( provider ) ;
5559 }
5660
You can’t perform that action at this time.
0 commit comments