/// <summary> /// Initializes a new instance of the <see cref="DynamicExpression"/> /// class with the specified expression and language. /// </summary> /// <param name="expression">The expression to parse.</param> /// <param name="language">The language of the expression to parse.</param> public DynamicExpression(string expression, ExpressionLanguage language) { Require.NotNull(expression, "expression"); Expression = expression; Language = language; Cached = DynamicExpressionCache.GetOrCreateCachedDynamicExpression(expression, language); }
/// <summary> /// Checks the syntax of the specified expression. /// </summary> /// <param name="expression">The expression of which to check the syntax.</param> /// <param name="language">The language used when checking the syntax.</param> public static void CheckSyntax(string expression, ExpressionLanguage language) { Require.NotEmpty(expression, "expression"); DynamicExpressionCache.ParseExpression(expression, language); }