File tree Expand file tree Collapse file tree 2 files changed +19
-0
lines changed
Expand file tree Collapse file tree 2 files changed +19
-0
lines changed Original file line number Diff line number Diff line change @@ -58,6 +58,16 @@ public MongoCollection Collection
5858 }
5959
6060 // public methods
61+ /// <summary>
62+ /// Builds the MongoDB query that will be sent to the server when the LINQ query is executed.
63+ /// </summary>
64+ /// <returns>The MongoDB query.</returns>
65+ public IMongoQuery BuildMongoQuery < T > ( MongoQueryable < T > query )
66+ {
67+ var translatedQuery = MongoQueryTranslator . Translate ( this , ( ( IQueryable ) query ) . Expression ) ;
68+ return ( ( SelectQuery ) translatedQuery ) . BuildQuery ( ) ;
69+ }
70+
6171 /// <summary>
6272 /// Creates a new instance of MongoQueryable{{T}} for this provider.
6373 /// </summary>
Original file line number Diff line number Diff line change @@ -82,6 +82,15 @@ public IEnumerator<T> GetEnumerator()
8282 return ( ( IEnumerable < T > ) _provider . Execute ( _expression ) ) . GetEnumerator ( ) ;
8383 }
8484
85+ /// <summary>
86+ /// Gets the MongoDB query that will be sent to the server when this LINQ query is executed.
87+ /// </summary>
88+ /// <returns>The MongoDB query.</returns>
89+ public IMongoQuery GetMongoQuery ( )
90+ {
91+ return _provider . BuildMongoQuery ( this ) ;
92+ }
93+
8594 // explicit implementation of IEnumerable
8695 IEnumerator IEnumerable . GetEnumerator ( )
8796 {
You can’t perform that action at this time.
0 commit comments