Class DynamicExpressionParser
Helper class to convert an expression into an LambdaExpression
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, [NotNull] ParameterExpression[] parameters, [CanBeNull] Type resultType, [NotNull] string expression, params object[] values)
Parameters
| Type | Name | Description |
|---|---|---|
| Boolean | createParameterCtor | if set to |
| ParameterExpression[] | parameters | A array from ParameterExpressions. |
| Type | resultType | Type of the result. If not specified, it will be generated dynamically. |
| String | expression | The expression. |
| Object[] | values | An object array that contains zero or more objects which are used as replacement values. |
Returns
| Type | Description |
|---|---|
| LambdaExpression | The generated LambdaExpression |
ParseLambda(Boolean, Type, Type, String, Object[])
Parses an expression into a LambdaExpression.
Declaration
[PublicAPI]
public static LambdaExpression ParseLambda(bool createParameterCtor, [NotNull] Type itType, [CanBeNull] Type resultType, string expression, params object[] values)
Parameters
| Type | Name | Description |
|---|---|---|
| Boolean | createParameterCtor | if set to |
| Type | itType | The main type from the dynamic class expression. |
| Type | resultType | Type of the result. If not specified, it will be generated dynamically. |
| String | expression | The expression. |
| Object[] | values | An object array that contains zero or more objects which are used as replacement values. |
Returns
| Type | Description |
|---|---|
| LambdaExpression | The generated LambdaExpression |
ParseLambda(ParsingConfig, Boolean, ParameterExpression[], Type, String, Object[])
Parses an expression into a LambdaExpression.
Declaration
[PublicAPI]
public static LambdaExpression ParseLambda([CanBeNull] ParsingConfig parsingConfig, bool createParameterCtor, [NotNull] ParameterExpression[] parameters, [CanBeNull] Type resultType, [NotNull] string expression, params object[] values)
Parameters
| Type | Name | Description |
|---|---|---|
| ParsingConfig | parsingConfig | The Configuration for the parsing. |
| Boolean | createParameterCtor | if set to |
| ParameterExpression[] | parameters | A array from ParameterExpressions. |
| Type | resultType | Type of the result. If not specified, it will be generated dynamically. |
| String | expression | The expression. |
| Object[] | values | An object array that contains zero or more objects which are used as replacement values. |
Returns
| Type | Description |
|---|---|
| LambdaExpression | The generated LambdaExpression |
ParseLambda(ParsingConfig, Boolean, Type, String, Object[])
Parses an expression into a LambdaExpression.
Declaration
[PublicAPI]
public static LambdaExpression ParseLambda([CanBeNull] ParsingConfig parsingConfig, bool createParameterCtor, [CanBeNull] Type resultType, [NotNull] string expression, params object[] values)
Parameters
| Type | Name | Description |
|---|---|---|
| ParsingConfig | parsingConfig | The Configuration for the parsing. |
| Boolean | createParameterCtor | if set to |
| Type | resultType | Type of the result. If not specified, it will be generated dynamically. |
| String | expression | The expression. |
| Object[] | values | An object array that contains zero or more objects which are used as replacement values. |
Returns
| Type | Description |
|---|---|
| LambdaExpression | The generated LambdaExpression |
ParseLambda(ParsingConfig, Boolean, Type, Type, String, Object[])
Parses an expression into a LambdaExpression.
Declaration
[PublicAPI]
public static LambdaExpression ParseLambda([CanBeNull] ParsingConfig parsingConfig, bool createParameterCtor, [NotNull] Type itType, [CanBeNull] Type resultType, string expression, params object[] values)
Parameters
| Type | Name | Description |
|---|---|---|
| ParsingConfig | parsingConfig | The Configuration for the parsing. |
| Boolean | createParameterCtor | if set to |
| Type | itType | The main type from the dynamic class expression. |
| Type | resultType | Type of the result. If not specified, it will be generated dynamically. |
| String | expression | The expression. |
| Object[] | values | An object array that contains zero or more objects which are used as replacement values. |
Returns
| Type | Description |
|---|---|
| LambdaExpression | The generated 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([CanBeNull] ParsingConfig parsingConfig, [NotNull] ParameterExpression[] parameters, [CanBeNull] Type resultType, string expression, params object[] values)
Parameters
| Type | Name | Description |
|---|---|---|
| ParsingConfig | parsingConfig | The Configuration for the parsing. |
| ParameterExpression[] | parameters | A array from ParameterExpressions. |
| Type | resultType | Type of the result. If not specified, it will be generated dynamically. |
| String | expression | The expression. |
| Object[] | values | An object array that contains zero or more objects which are used as replacement values. |
Returns
| Type | Description |
|---|---|
| LambdaExpression | The generated 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([CanBeNull] ParsingConfig parsingConfig, [CanBeNull] Type resultType, [NotNull] string expression, params object[] values)
Parameters
| Type | Name | Description |
|---|---|---|
| ParsingConfig | parsingConfig | The Configuration for the parsing. |
| Type | resultType | Type of the result. If not specified, it will be generated dynamically. |
| String | expression | The expression. |
| Object[] | values | An object array that contains zero or more objects which are used as replacement values. |
Returns
| Type | Description |
|---|---|
| LambdaExpression | The generated 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([CanBeNull] ParsingConfig parsingConfig, [NotNull] Type itType, [CanBeNull] Type resultType, string expression, params object[] values)
Parameters
| Type | Name | Description |
|---|---|---|
| ParsingConfig | parsingConfig | The Configuration for the parsing. |
| Type | itType | The main type from the dynamic class expression. |
| Type | resultType | Type of the result. If not specified, it will be generated dynamically. |
| String | expression | The expression. |
| Object[] | values | An object array that contains zero or more objects which are used as replacement values. |
Returns
| Type | Description |
|---|---|
| LambdaExpression | The generated 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([NotNull] ParameterExpression[] parameters, [CanBeNull] Type resultType, string expression, params object[] values)
Parameters
| Type | Name | Description |
|---|---|---|
| ParameterExpression[] | parameters | A array from ParameterExpressions. |
| Type | resultType | Type of the result. If not specified, it will be generated dynamically. |
| String | expression | The expression. |
| Object[] | values | An object array that contains zero or more objects which are used as replacement values. |
Returns
| Type | Description |
|---|---|
| LambdaExpression | The generated 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([CanBeNull] Type resultType, [NotNull] string expression, params object[] values)
Parameters
| Type | Name | Description |
|---|---|---|
| Type | resultType | Type of the result. If not specified, it will be generated dynamically. |
| String | expression | The expression. |
| Object[] | values | An object array that contains zero or more objects which are used as replacement values. |
Returns
| Type | Description |
|---|---|
| LambdaExpression | The generated 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([NotNull] Type itType, [CanBeNull] Type resultType, string expression, params object[] values)
Parameters
| Type | Name | Description |
|---|---|---|
| Type | itType | The main type from the dynamic class expression. |
| Type | resultType | Type of the result. If not specified, it will be generated dynamically. |
| String | expression | The expression. |
| Object[] | values | An object array that contains zero or more objects which are used as replacement values. |
Returns
| Type | Description |
|---|---|
| LambdaExpression | The generated LambdaExpression |
ParseLambda<TResult>(ParsingConfig, Boolean, ParameterExpression[], String, Object[])
Parses an expression into a Typed Expression.
Declaration
[PublicAPI]
public static Expression<Func<TResult>> ParseLambda<TResult>([CanBeNull] ParsingConfig parsingConfig, bool createParameterCtor, [NotNull] ParameterExpression[] parameters, [NotNull] string expression, params object[] values)
Parameters
| Type | Name | Description |
|---|---|---|
| ParsingConfig | parsingConfig | The Configuration for the parsing. |
| Boolean | createParameterCtor | if set to |
| ParameterExpression[] | parameters | A array from ParameterExpressions. |
| String | expression | The expression. |
| Object[] | values | An object array that contains zero or more objects which are used as replacement values. |
Returns
| Type | Description |
|---|---|
| Expression<Func<TResult>> | The generated 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>([CanBeNull] ParsingConfig parsingConfig, bool createParameterCtor, [NotNull] string expression, params object[] values)
Parameters
| Type | Name | Description |
|---|---|---|
| ParsingConfig | parsingConfig | The Configuration for the parsing. |
| Boolean | createParameterCtor | if set to |
| String | expression | The expression. |
| Object[] | values | An object array that contains zero or more objects which are used as replacement values. |
Returns
| Type | Description |
|---|---|
| Expression<Func<TResult>> | The generated 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>([CanBeNull] ParsingConfig parsingConfig, bool createParameterCtor, [NotNull] string expression, params object[] values)
Parameters
| Type | Name | Description |
|---|---|---|
| ParsingConfig | parsingConfig | The Configuration for the parsing. |
| Boolean | createParameterCtor | if set to |
| String | expression | The expression. |
| Object[] | values | An object array that contains zero or more objects which are used as replacement values. |
Returns
| Type | Description |
|---|---|
| Expression<Func<T, TResult>> | The generated Expression |
Type Parameters
| Name | Description |
|---|---|
| T | The |
| TResult | The type of the result. |