Class DynamicExpressionParser
Helper class to convert an expression into an LambdaExpression
Inheritance
Inherited Members
Namespace: System.Linq.Dynamic.Core
Assembly: System.Linq.Dynamic.Core.dll
Syntax
public static class DynamicExpressionParser
Methods
| Improve this Doc View SourceParseLambda(Boolean, ParameterExpression[], Type, String, Object[])
Parses an expression into a LambdaExpression.
Declaration
[PublicAPI]
public static LambdaExpression ParseLambda(bool createParameterCtor, ParameterExpression[] parameters, Type resultType, string expression, params object[] values)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Boolean | createParameterCtor | if set to |
| System.Linq.Expressions.ParameterExpression[] | parameters | A array from ParameterExpressions. |
| System.Type | resultType | Type of the result. If not specified, it will be generated dynamically. |
| System.String | expression | The expression. |
| System.Object[] | values | An object array that contains zero or more objects which are used as replacement values. |
Returns
| Type | Description |
|---|---|
| System.Linq.Expressions.LambdaExpression | The generated System.Linq.Expressions.LambdaExpression |
ParseLambda(Boolean, Type, Type, String, Object[])
Parses an expression into a LambdaExpression.
Declaration
[PublicAPI]
public static LambdaExpression ParseLambda(bool createParameterCtor, Type itType, Type resultType, string expression, params object[] values)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Boolean | createParameterCtor | if set to |
| System.Type | itType | The main type from the dynamic class expression. |
| System.Type | resultType | Type of the result. If not specified, it will be generated dynamically. |
| System.String | expression | The expression. |
| System.Object[] | values | An object array that contains zero or more objects which are used as replacement values. |
Returns
| Type | Description |
|---|---|
| System.Linq.Expressions.LambdaExpression | The generated System.Linq.Expressions.LambdaExpression |
ParseLambda(ParsingConfig, Boolean, ParameterExpression[], Type, String, Object[])
Parses an expression into a LambdaExpression.
Declaration
[PublicAPI]
public static LambdaExpression ParseLambda(ParsingConfig parsingConfig, bool createParameterCtor, ParameterExpression[] parameters, Type resultType, string expression, params object[] values)
Parameters
| Type | Name | Description |
|---|---|---|
| ParsingConfig | parsingConfig | The Configuration for the parsing. |
| System.Boolean | createParameterCtor | if set to |
| System.Linq.Expressions.ParameterExpression[] | parameters | A array from ParameterExpressions. |
| System.Type | resultType | Type of the result. If not specified, it will be generated dynamically. |
| System.String | expression | The expression. |
| System.Object[] | values | An object array that contains zero or more objects which are used as replacement values. |
Returns
| Type | Description |
|---|---|
| System.Linq.Expressions.LambdaExpression | The generated System.Linq.Expressions.LambdaExpression |
ParseLambda(ParsingConfig, Boolean, Type, String, Object[])
Parses an expression into a LambdaExpression.
Declaration
[PublicAPI]
public static LambdaExpression ParseLambda(ParsingConfig parsingConfig, bool createParameterCtor, Type resultType, string expression, params object[] values)
Parameters
| Type | Name | Description |
|---|---|---|
| ParsingConfig | parsingConfig | The Configuration for the parsing. |
| System.Boolean | createParameterCtor | if set to |
| System.Type | resultType | Type of the result. If not specified, it will be generated dynamically. |
| System.String | expression | The expression. |
| System.Object[] | values | An object array that contains zero or more objects which are used as replacement values. |
Returns
| Type | Description |
|---|---|
| System.Linq.Expressions.LambdaExpression | The generated System.Linq.Expressions.LambdaExpression |
ParseLambda(ParsingConfig, Boolean, Type, Type, String, Object[])
Parses an expression into a LambdaExpression.
Declaration
[PublicAPI]
public static LambdaExpression ParseLambda(ParsingConfig parsingConfig, bool createParameterCtor, Type itType, Type resultType, string expression, params object[] values)
Parameters
| Type | Name | Description |
|---|---|---|
| ParsingConfig | parsingConfig | The Configuration for the parsing. |
| System.Boolean | createParameterCtor | if set to |
| System.Type | itType | The main type from the dynamic class expression. |
| System.Type | resultType | Type of the result. If not specified, it will be generated dynamically. |
| System.String | expression | The expression. |
| System.Object[] | values | An object array that contains zero or more objects which are used as replacement values. |
Returns
| Type | Description |
|---|---|
| System.Linq.Expressions.LambdaExpression | The generated System.Linq.Expressions.LambdaExpression |
ParseLambda(ParsingConfig, ParameterExpression[], Type, String, Object[])
Parses an expression into a LambdaExpression. (Also create a constructor for all the parameters. Note that this doesn't work for Linq-to-Database entities.)
Declaration
[PublicAPI]
public static LambdaExpression ParseLambda(ParsingConfig parsingConfig, ParameterExpression[] parameters, Type resultType, string expression, params object[] values)
Parameters
| Type | Name | Description |
|---|---|---|
| ParsingConfig | parsingConfig | The Configuration for the parsing. |
| System.Linq.Expressions.ParameterExpression[] | parameters | A array from ParameterExpressions. |
| System.Type | resultType | Type of the result. If not specified, it will be generated dynamically. |
| System.String | expression | The expression. |
| System.Object[] | values | An object array that contains zero or more objects which are used as replacement values. |
Returns
| Type | Description |
|---|---|
| System.Linq.Expressions.LambdaExpression | The generated System.Linq.Expressions.LambdaExpression |
ParseLambda(ParsingConfig, Type, String, Object[])
Parses an expression into a LambdaExpression. (Also create a constructor for all the parameters. Note that this doesn't work for Linq-to-Database entities.)
Declaration
[PublicAPI]
public static LambdaExpression ParseLambda(ParsingConfig parsingConfig, Type resultType, string expression, params object[] values)
Parameters
| Type | Name | Description |
|---|---|---|
| ParsingConfig | parsingConfig | The Configuration for the parsing. |
| System.Type | resultType | Type of the result. If not specified, it will be generated dynamically. |
| System.String | expression | The expression. |
| System.Object[] | values | An object array that contains zero or more objects which are used as replacement values. |
Returns
| Type | Description |
|---|---|
| System.Linq.Expressions.LambdaExpression | The generated System.Linq.Expressions.LambdaExpression |
ParseLambda(ParsingConfig, Type, Type, String, Object[])
Parses an expression into a LambdaExpression. (Also create a constructor for all the parameters. Note that this doesn't work for Linq-to-Database entities.)
Declaration
[PublicAPI]
public static LambdaExpression ParseLambda(ParsingConfig parsingConfig, Type itType, Type resultType, string expression, params object[] values)
Parameters
| Type | Name | Description |
|---|---|---|
| ParsingConfig | parsingConfig | The Configuration for the parsing. |
| System.Type | itType | The main type from the dynamic class expression. |
| System.Type | resultType | Type of the result. If not specified, it will be generated dynamically. |
| System.String | expression | The expression. |
| System.Object[] | values | An object array that contains zero or more objects which are used as replacement values. |
Returns
| Type | Description |
|---|---|
| System.Linq.Expressions.LambdaExpression | The generated System.Linq.Expressions.LambdaExpression |
ParseLambda(ParameterExpression[], Type, String, Object[])
Parses an expression into a LambdaExpression. (Also create a constructor for all the parameters. Note that this doesn't work for Linq-to-Database entities.)
Declaration
[PublicAPI]
public static LambdaExpression ParseLambda(ParameterExpression[] parameters, Type resultType, string expression, params object[] values)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Linq.Expressions.ParameterExpression[] | parameters | A array from ParameterExpressions. |
| System.Type | resultType | Type of the result. If not specified, it will be generated dynamically. |
| System.String | expression | The expression. |
| System.Object[] | values | An object array that contains zero or more objects which are used as replacement values. |
Returns
| Type | Description |
|---|---|
| System.Linq.Expressions.LambdaExpression | The generated System.Linq.Expressions.LambdaExpression |
ParseLambda(Type, ParsingConfig, Boolean, ParameterExpression[], Type, String, Object[])
Parses an expression into a LambdaExpression.
Declaration
[PublicAPI]
public static LambdaExpression ParseLambda(Type delegateType, ParsingConfig parsingConfig, bool createParameterCtor, ParameterExpression[] parameters, Type resultType, string expression, params object[] values)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Type | delegateType | The delegate type. |
| ParsingConfig | parsingConfig | The Configuration for the parsing. |
| System.Boolean | createParameterCtor | if set to |
| System.Linq.Expressions.ParameterExpression[] | parameters | A array from ParameterExpressions. |
| System.Type | resultType | Type of the result. If not specified, it will be generated dynamically. |
| System.String | expression | The expression. |
| System.Object[] | values | An object array that contains zero or more objects which are used as replacement values. |
Returns
| Type | Description |
|---|---|
| System.Linq.Expressions.LambdaExpression | The generated System.Linq.Expressions.LambdaExpression |
ParseLambda(Type, ParsingConfig, Boolean, Type, String, Object[])
Parses an expression into a LambdaExpression.
Declaration
[PublicAPI]
public static LambdaExpression ParseLambda(Type delegateType, ParsingConfig parsingConfig, bool createParameterCtor, Type resultType, string expression, params object[] values)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Type | delegateType | The delegate type. |
| ParsingConfig | parsingConfig | The Configuration for the parsing. |
| System.Boolean | createParameterCtor | if set to |
| System.Type | resultType | Type of the result. If not specified, it will be generated dynamically. |
| System.String | expression | The expression. |
| System.Object[] | values | An object array that contains zero or more objects which are used as replacement values. |
Returns
| Type | Description |
|---|---|
| System.Linq.Expressions.LambdaExpression | The generated System.Linq.Expressions.LambdaExpression |
ParseLambda(Type, ParsingConfig, Boolean, Type, Type, String, Object[])
Parses an expression into a LambdaExpression.
Declaration
[PublicAPI]
public static LambdaExpression ParseLambda(Type delegateType, ParsingConfig parsingConfig, bool createParameterCtor, Type itType, Type resultType, string expression, params object[] values)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Type | delegateType | The delegate type. |
| ParsingConfig | parsingConfig | The Configuration for the parsing. |
| System.Boolean | createParameterCtor | if set to |
| System.Type | itType | The main type from the dynamic class expression. |
| System.Type | resultType | Type of the result. If not specified, it will be generated dynamically. |
| System.String | expression | The expression. |
| System.Object[] | values | An object array that contains zero or more objects which are used as replacement values. |
Returns
| Type | Description |
|---|---|
| System.Linq.Expressions.LambdaExpression | The generated System.Linq.Expressions.LambdaExpression |
ParseLambda(Type, ParsingConfig, ParameterExpression[], Type, String, Object[])
Parses an expression into a LambdaExpression. (Also create a constructor for all the parameters. Note that this doesn't work for Linq-to-Database entities.)
Declaration
[PublicAPI]
public static LambdaExpression ParseLambda(Type delegateType, ParsingConfig parsingConfig, ParameterExpression[] parameters, Type resultType, string expression, params object[] values)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Type | delegateType | The delegate type. |
| ParsingConfig | parsingConfig | The Configuration for the parsing. |
| System.Linq.Expressions.ParameterExpression[] | parameters | A array from ParameterExpressions. |
| System.Type | resultType | Type of the result. If not specified, it will be generated dynamically. |
| System.String | expression | The expression. |
| System.Object[] | values | An object array that contains zero or more objects which are used as replacement values. |
Returns
| Type | Description |
|---|---|
| System.Linq.Expressions.LambdaExpression | The generated System.Linq.Expressions.LambdaExpression |
ParseLambda(Type, ParsingConfig, Type, String, Object[])
Parses an expression into a LambdaExpression. (Also create a constructor for all the parameters. Note that this doesn't work for Linq-to-Database entities.)
Declaration
[PublicAPI]
public static LambdaExpression ParseLambda(Type delegateType, ParsingConfig parsingConfig, Type resultType, string expression, params object[] values)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Type | delegateType | The delegate type. |
| ParsingConfig | parsingConfig | The Configuration for the parsing. |
| System.Type | resultType | Type of the result. If not specified, it will be generated dynamically. |
| System.String | expression | The expression. |
| System.Object[] | values | An object array that contains zero or more objects which are used as replacement values. |
Returns
| Type | Description |
|---|---|
| System.Linq.Expressions.LambdaExpression | The generated System.Linq.Expressions.LambdaExpression |
ParseLambda(Type, ParsingConfig, Type, Type, String, Object[])
Parses an expression into a LambdaExpression. (Also create a constructor for all the parameters. Note that this doesn't work for Linq-to-Database entities.)
Declaration
[PublicAPI]
public static LambdaExpression ParseLambda(Type delegateType, ParsingConfig parsingConfig, Type itType, Type resultType, string expression, params object[] values)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Type | delegateType | The delegate type. |
| ParsingConfig | parsingConfig | The Configuration for the parsing. |
| System.Type | itType | The main type from the dynamic class expression. |
| System.Type | resultType | Type of the result. If not specified, it will be generated dynamically. |
| System.String | expression | The expression. |
| System.Object[] | values | An object array that contains zero or more objects which are used as replacement values. |
Returns
| Type | Description |
|---|---|
| System.Linq.Expressions.LambdaExpression | The generated System.Linq.Expressions.LambdaExpression |
ParseLambda(Type, ParameterExpression[], Type, String, Object[])
Parses an expression into a LambdaExpression. (Also create a constructor for all the parameters. Note that this doesn't work for Linq-to-Database entities.)
Declaration
[PublicAPI]
public static LambdaExpression ParseLambda(Type delegateType, ParameterExpression[] parameters, Type resultType, string expression, params object[] values)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Type | delegateType | The delegate type. |
| System.Linq.Expressions.ParameterExpression[] | parameters | A array from ParameterExpressions. |
| System.Type | resultType | Type of the result. If not specified, it will be generated dynamically. |
| System.String | expression | The expression. |
| System.Object[] | values | An object array that contains zero or more objects which are used as replacement values. |
Returns
| Type | Description |
|---|---|
| System.Linq.Expressions.LambdaExpression | The generated System.Linq.Expressions.LambdaExpression |
ParseLambda(Type, String, Object[])
Parses an expression into a LambdaExpression. (Also create a constructor for all the parameters. Note that this doesn't work for Linq-to-Database entities.)
Declaration
[PublicAPI]
public static LambdaExpression ParseLambda(Type resultType, string expression, params object[] values)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Type | resultType | Type of the result. If not specified, it will be generated dynamically. |
| System.String | expression | The expression. |
| System.Object[] | values | An object array that contains zero or more objects which are used as replacement values. |
Returns
| Type | Description |
|---|---|
| System.Linq.Expressions.LambdaExpression | The generated System.Linq.Expressions.LambdaExpression |
ParseLambda(Type, Type, String, Object[])
Parses an expression into a LambdaExpression. (Also create a constructor for all the parameters. Note that this doesn't work for Linq-to-Database entities.)
Declaration
[PublicAPI]
public static LambdaExpression ParseLambda(Type itType, Type resultType, string expression, params object[] values)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Type | itType | The main type from the dynamic class expression. |
| System.Type | resultType | Type of the result. If not specified, it will be generated dynamically. |
| System.String | expression | The expression. |
| System.Object[] | values | An object array that contains zero or more objects which are used as replacement values. |
Returns
| Type | Description |
|---|---|
| System.Linq.Expressions.LambdaExpression | The generated System.Linq.Expressions.LambdaExpression |
ParseLambda<TResult>(ParsingConfig, Boolean, ParameterExpression[], String, Object[])
Parses an expression into a Typed Expression.
Declaration
[PublicAPI]
public static Expression<Func<TResult>> ParseLambda<TResult>(ParsingConfig parsingConfig, bool createParameterCtor, ParameterExpression[] parameters, string expression, params object[] values)
Parameters
| Type | Name | Description |
|---|---|---|
| ParsingConfig | parsingConfig | The Configuration for the parsing. |
| System.Boolean | createParameterCtor | if set to |
| System.Linq.Expressions.ParameterExpression[] | parameters | A array from ParameterExpressions. |
| System.String | expression | The expression. |
| System.Object[] | values | An object array that contains zero or more objects which are used as replacement values. |
Returns
| Type | Description |
|---|---|
| System.Linq.Expressions.Expression<System.Func<TResult>> | The generated System.Linq.Expressions.Expression |
Type Parameters
| Name | Description |
|---|---|
| TResult | The type of the result. |
ParseLambda<TResult>(ParsingConfig, Boolean, String, Object[])
Parses an expression into a Typed Expression.
Declaration
[PublicAPI]
public static Expression<Func<TResult>> ParseLambda<TResult>(ParsingConfig parsingConfig, bool createParameterCtor, string expression, params object[] values)
Parameters
| Type | Name | Description |
|---|---|---|
| ParsingConfig | parsingConfig | The Configuration for the parsing. |
| System.Boolean | createParameterCtor | if set to |
| System.String | expression | The expression. |
| System.Object[] | values | An object array that contains zero or more objects which are used as replacement values. |
Returns
| Type | Description |
|---|---|
| System.Linq.Expressions.Expression<System.Func<TResult>> | The generated System.Linq.Expressions.Expression |
Type Parameters
| Name | Description |
|---|---|
| TResult | The type of the result. |
ParseLambda<TResult>(Type, ParsingConfig, Boolean, ParameterExpression[], String, Object[])
Parses an expression into a Typed Expression.
Declaration
[PublicAPI]
public static Expression<Func<TResult>> ParseLambda<TResult>(Type delegateType, ParsingConfig parsingConfig, bool createParameterCtor, ParameterExpression[] parameters, string expression, params object[] values)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Type | delegateType | The delegate type. |
| ParsingConfig | parsingConfig | The Configuration for the parsing. |
| System.Boolean | createParameterCtor | if set to |
| System.Linq.Expressions.ParameterExpression[] | parameters | A array from ParameterExpressions. |
| System.String | expression | The expression. |
| System.Object[] | values | An object array that contains zero or more objects which are used as replacement values. |
Returns
| Type | Description |
|---|---|
| System.Linq.Expressions.Expression<System.Func<TResult>> | The generated System.Linq.Expressions.Expression |
Type Parameters
| Name | Description |
|---|---|
| TResult | The type of the result. |
ParseLambda<TResult>(Type, ParsingConfig, Boolean, String, Object[])
Parses an expression into a Typed Expression.
Declaration
[PublicAPI]
public static Expression<Func<TResult>> ParseLambda<TResult>(Type delegateType, ParsingConfig parsingConfig, bool createParameterCtor, string expression, params object[] values)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Type | delegateType | The delegate type. |
| ParsingConfig | parsingConfig | The Configuration for the parsing. |
| System.Boolean | createParameterCtor | if set to |
| System.String | expression | The expression. |
| System.Object[] | values | An object array that contains zero or more objects which are used as replacement values. |
Returns
| Type | Description |
|---|---|
| System.Linq.Expressions.Expression<System.Func<TResult>> | The generated System.Linq.Expressions.Expression |
Type Parameters
| Name | Description |
|---|---|
| TResult | The type of the result. |
ParseLambda<T, TResult>(ParsingConfig, Boolean, String, Object[])
Parses an expression into a Typed Expression.
Declaration
[PublicAPI]
public static Expression<Func<T, TResult>> ParseLambda<T, TResult>(ParsingConfig parsingConfig, bool createParameterCtor, string expression, params object[] values)
Parameters
| Type | Name | Description |
|---|---|---|
| ParsingConfig | parsingConfig | The Configuration for the parsing. |
| System.Boolean | createParameterCtor | if set to |
| System.String | expression | The expression. |
| System.Object[] | values | An object array that contains zero or more objects which are used as replacement values. |
Returns
| Type | Description |
|---|---|
| System.Linq.Expressions.Expression<System.Func<T, TResult>> | The generated System.Linq.Expressions.Expression |
Type Parameters
| Name | Description |
|---|---|
| T | The |
| TResult | The type of the result. |
ParseLambda<T, TResult>(Type, ParsingConfig, Boolean, String, Object[])
Parses an expression into a Typed Expression.
Declaration
[PublicAPI]
public static Expression<Func<T, TResult>> ParseLambda<T, TResult>(Type delegateType, ParsingConfig parsingConfig, bool createParameterCtor, string expression, params object[] values)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Type | delegateType | The delegate type. |
| ParsingConfig | parsingConfig | The Configuration for the parsing. |
| System.Boolean | createParameterCtor | if set to |
| System.String | expression | The expression. |
| System.Object[] | values | An object array that contains zero or more objects which are used as replacement values. |
Returns
| Type | Description |
|---|---|
| System.Linq.Expressions.Expression<System.Func<T, TResult>> | The generated System.Linq.Expressions.Expression |
Type Parameters
| Name | Description |
|---|---|
| T | The |
| TResult | The type of the result. |