internal static string ExpressionToOQL(DbContext context, Expression node, out OQLBuilder oqlBuilder) { Debug.Assert(node != null); ValidationResult result = new OQLQueryAnalyzer(node).ValidateQuery(); if (!result.IsValid) { throw new Exception(result.Reason); } oqlBuilder = new OQLBuilder(context); oqlBuilder.Visit(node); return(oqlBuilder.BuildQuery()); }