Skip to content

Commit 1006e4f

Browse files
author
rstam
committed
Renamed some of the LINQ implementation classes (to shorter and better names).
1 parent 68939e2 commit 1006e4f

File tree

7 files changed

+16
-15
lines changed

7 files changed

+16
-15
lines changed

Driver/Driver.csproj

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -183,12 +183,12 @@
183183
<Compile Include="Linq\Evaluator.cs" />
184184
<Compile Include="Linq\ExpressionPrettyPrinter.cs" />
185185
<Compile Include="Linq\ExpressionVisitor.cs" />
186-
<Compile Include="Linq\MongoLinqFindQuery.cs" />
187-
<Compile Include="Linq\MongoLinqExtensionMethods.cs" />
186+
<Compile Include="Linq\TranslatedFindQuery.cs" />
187+
<Compile Include="Linq\ExtensionMethods.cs" />
188188
<Compile Include="Linq\MongoQueryable.cs" />
189189
<Compile Include="Linq\MongoQueryProvider.cs" />
190-
<Compile Include="Linq\MongoLinqTranslator.cs" />
191-
<Compile Include="Linq\MongoLinqQuery.cs" />
190+
<Compile Include="Linq\MongoQueryTranslator.cs" />
191+
<Compile Include="Linq\TranslatedQuery.cs" />
192192
<Compile Include="Linq\TypeSystem.cs" />
193193
<Compile Include="MongoUtils.cs" />
194194
<Compile Include="MongoDefaults.cs" />

Driver/Linq/MongoLinqExtensionMethods.cs renamed to Driver/Linq/ExtensionMethods.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ namespace MongoDB.Driver.Linq
2626
/// <summary>
2727
/// Static class that contains the Mongo Linq extension methods.
2828
/// </summary>
29-
public static class MongoLinqExtensionMethods
29+
public static class ExtensionMethods
3030
{
3131
/// <summary>
3232
/// Returns an instance of IQueryable{{T}} for a MongoCollection.

Driver/Linq/MongoQueryProvider.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,7 @@ public TResult Execute<TResult>(Expression expression)
182182
{
183183
throw new ArgumentException("Argument expression is not valid.");
184184
}
185-
var translatedQuery = MongoLinqTranslator.Translate(_collection, expression);
185+
var translatedQuery = MongoQueryTranslator.Translate(_collection, expression);
186186
return (TResult)translatedQuery.Execute();
187187
}
188188

@@ -225,7 +225,7 @@ public IEnumerator<T> GetEnumerator<T>(Expression expression)
225225
{
226226
throw new ArgumentException("Argument expression is not valid.");
227227
}
228-
var translatedQuery = MongoLinqTranslator.Translate(_collection, expression);
228+
var translatedQuery = MongoQueryTranslator.Translate(_collection, expression);
229229
return translatedQuery.GetEnumerator<T>();
230230
}
231231

@@ -236,7 +236,7 @@ public IEnumerator<T> GetEnumerator<T>(Expression expression)
236236
/// <returns>A string.</returns>
237237
public string GetQueryText(Expression expression)
238238
{
239-
var translatedQuery = MongoLinqTranslator.Translate(_collection, expression);
239+
var translatedQuery = MongoQueryTranslator.Translate(_collection, expression);
240240
return translatedQuery.ToString();
241241
}
242242
}

Driver/Linq/MongoLinqTranslator.cs renamed to Driver/Linq/MongoQueryTranslator.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ namespace MongoDB.Driver.Linq
2525
/// <summary>
2626
/// A translator from LINQ expression queries to Mongo queries.
2727
/// </summary>
28-
public static class MongoLinqTranslator
28+
public static class MongoQueryTranslator
2929
{
3030
// public static methods
3131
/// <summary>
@@ -34,13 +34,13 @@ public static class MongoLinqTranslator
3434
/// <param name="collection">The collection being queried.</param>
3535
/// <param name="expression">The LINQ query.</param>
3636
/// <returns>An instance of MongoLinqQuery.</returns>
37-
public static MongoLinqQuery Translate(MongoCollection collection, Expression expression)
37+
public static TranslatedQuery Translate(MongoCollection collection, Expression expression)
3838
{
3939
expression = Evaluator.PartialEval(expression);
4040

4141
// total hack just to test the initial LINQ framework
4242
var query = MongoDB.Driver.Builders.Query.EQ("X", 1);
43-
return new MongoLinqFindQuery(collection, query);
43+
return new TranslatedFindQuery(collection, query);
4444
}
4545
}
4646
}

Driver/Linq/MongoQueryable.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ namespace MongoDB.Driver.Linq
2828
{
2929
/// <summary>
3030
/// An implementation of IQueryable{{T}} for querying a MongoDB collection.
31+
/// This class has been named MongoQueryable instead of MongoQuery to avoid confusion with IMongoQuery.
3132
/// </summary>
3233
public class MongoQueryable<T> : IOrderedQueryable<T>
3334
{

Driver/Linq/MongoLinqFindQuery.cs renamed to Driver/Linq/TranslatedFindQuery.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ namespace MongoDB.Driver.Linq
2525
/// <summary>
2626
/// Represents a LINQ query that has been translated to an equivalent MongoDB Find query.
2727
/// </summary>
28-
public class MongoLinqFindQuery : MongoLinqQuery
28+
public class TranslatedFindQuery : TranslatedQuery
2929
{
3030
// private fields
3131
private IMongoQuery _query;
@@ -36,7 +36,7 @@ public class MongoLinqFindQuery : MongoLinqQuery
3636
/// </summary>
3737
/// <param name="collection">The collection being queried.</param>
3838
/// <param name="query">The query.</param>
39-
public MongoLinqFindQuery(MongoCollection collection, IMongoQuery query)
39+
public TranslatedFindQuery(MongoCollection collection, IMongoQuery query)
4040
: base(collection)
4141
{
4242
_query = query;

Driver/Linq/MongoLinqQuery.cs renamed to Driver/Linq/TranslatedQuery.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ namespace MongoDB.Driver.Linq
2525
/// <summary>
2626
/// Represents a LINQ query that has been translated to a MongoDB query.
2727
/// </summary>
28-
public abstract class MongoLinqQuery
28+
public abstract class TranslatedQuery
2929
{
3030
// protected fields
3131
/// <summary>
@@ -38,7 +38,7 @@ public abstract class MongoLinqQuery
3838
/// Initializes a new instance of the MongoLinqQuery class.
3939
/// </summary>
4040
/// <param name="collection">The collection being queried.</param>
41-
protected MongoLinqQuery(MongoCollection collection)
41+
protected TranslatedQuery(MongoCollection collection)
4242
{
4343
_collection = collection;
4444
}

0 commit comments

Comments
 (0)