public Translate ( |
||
expression | The LINQ query expression tree. | |
Результат | void |
/// <summary> /// Translate a MongoDB LINQ query. /// </summary> /// <param name="provider">The MongoDB query provider.</param> /// <param name="expression">The LINQ query expression.</param> /// <returns>A TranslatedQuery.</returns> public static TranslatedQuery Translate(MongoQueryProvider provider, Expression expression) { expression = PartialEvaluator.Evaluate(expression, provider.CanBeEvaluatedLocally); // assume for now it's a SelectQuery var documentType = GetDocumentType(expression); var selectQuery = new SelectQuery(provider.Collection, documentType); selectQuery.Translate(expression); return selectQuery; }
/// <summary> /// Translate a MongoDB LINQ query. /// </summary> /// <param name="provider">The MongoDB query provider.</param> /// <param name="expression">The LINQ query expression.</param> /// <returns>A TranslatedQuery.</returns> public static TranslatedQuery Translate(MongoQueryProvider provider, Expression expression) { expression = PartialEvaluator.Evaluate(expression, provider.CanBeEvaluatedLocally); // assume for now it's a SelectQuery var documentType = GetDocumentType(expression); var selectQuery = new SelectQuery(provider.Collection, documentType); selectQuery.Translate(expression); return(selectQuery); }