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
58
58
}
59
59
60
60
// 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
+
61
71
/// <summary>
62
72
/// Creates a new instance of MongoQueryable{{T}} for this provider.
63
73
/// </summary>
Original file line number Diff line number Diff line change @@ -82,6 +82,15 @@ public IEnumerator<T> GetEnumerator()
82
82
return ( ( IEnumerable < T > ) _provider . Execute ( _expression ) ) . GetEnumerator ( ) ;
83
83
}
84
84
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
+
85
94
// explicit implementation of IEnumerable
86
95
IEnumerator IEnumerable . GetEnumerator ( )
87
96
{
You can’t perform that action at this time.
0 commit comments