Exemple #1
0
        internal static string BuildWhereClause(DbContext context, Expression node, out OQLBuilder builder)
        {
            builder = new OQLBuilder(context);

            builder.Visit(node);

            return(builder.whereBuilder.ToString());
        }
Exemple #2
0
        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());
        }