Provides methods for constructing expressions at runtime
More...
|
static LambdaExpression | MakePropertyOrFieldSelector (Type type, string propertyOrField) |
| Constructs a selector of the form: x => x.propertyOrField where x is an instance of 'type' More...
|
|
static Expression< Func< T, TProperty > > | MakePropertyOrFieldSelector< T, TProperty > (string propertyOrField) |
| Constructs a selector of the form: x => x.propertyOrField where x is an instance of 'type' More...
|
|
static Expression< Func< T, T, bool > > | MakeBinaryComparisonLambda< T > (ExpressionType type) |
| Constructs a lambda expression that accepts two parameters of type T and applies the specified binary comparison and returns the boolean result. More...
|
|
static bool | IsBinaryComparison (this ExpressionType type) |
| Determines whether or not the specified type is a binary comparison. More...
|
|
static IEnumerable< Expression > | AsEnumerable (this Expression expression) |
| Converts the specified expression into an enumerable of expressions by walking the expression tree More...
|
|
static IEnumerable< T > | OfType< T > (this Expression expression) |
| Returns all the expressions of the specified type in the given expression tree More...
|
|
static T | Single< T > (this Expression expression) |
| Returns the single expression of the specified type or throws if none or more than one expression of the specified type is contained within the expression. More...
|
|
static T | Single< T > (this IEnumerable< Expression > expressions) |
| Returns the single expression of the specified type or throws if none or more than one expression of the specified type is contained within the expression. More...
|
|
Provides methods for constructing expressions at runtime
Definition at line 26 of file ExpressionBuilder.cs.
◆ MakePropertyOrFieldSelector()
static LambdaExpression QuantConnect.Util.ExpressionBuilder.MakePropertyOrFieldSelector |
( |
Type |
type, |
|
|
string |
propertyOrField |
|
) |
| |
|
static |
Constructs a selector of the form: x => x.propertyOrField where x is an instance of 'type'
- Parameters
-
type | The type of the parameter in the expression |
propertyOrField | The name of the property or field to bind to |
- Returns
- A new lambda expression that represents accessing the property or field on 'type'
Definition at line 34 of file ExpressionBuilder.cs.
◆ MakePropertyOrFieldSelector< T, TProperty >()
Constructs a selector of the form: x => x.propertyOrField where x is an instance of 'type'
- Template Parameters
-
T | The type of the parameter in the expression |
TProperty | The type of the property or field being accessed in the expression |
- Parameters
-
propertyOrField | The name of the property or field to bind to |
- Returns
- A new lambda expression that represents accessing the property or field on 'type'
Definition at line 49 of file ExpressionBuilder.cs.
◆ MakeBinaryComparisonLambda< T >()
static Expression<Func<T, T, bool> > QuantConnect.Util.ExpressionBuilder.MakeBinaryComparisonLambda< T > |
( |
ExpressionType |
type | ) |
|
|
static |
Constructs a lambda expression that accepts two parameters of type T and applies the specified binary comparison and returns the boolean result.
Definition at line 58 of file ExpressionBuilder.cs.
◆ IsBinaryComparison()
static bool QuantConnect.Util.ExpressionBuilder.IsBinaryComparison |
( |
this ExpressionType |
type | ) |
|
|
static |
Determines whether or not the specified type is a binary comparison.
Definition at line 75 of file ExpressionBuilder.cs.
◆ AsEnumerable()
static IEnumerable<Expression> QuantConnect.Util.ExpressionBuilder.AsEnumerable |
( |
this Expression |
expression | ) |
|
|
static |
Converts the specified expression into an enumerable of expressions by walking the expression tree
- Parameters
-
expression | The expression to enumerate |
- Returns
- An enumerable containing all expressions in the input expression
Definition at line 97 of file ExpressionBuilder.cs.
◆ OfType< T >()
static IEnumerable<T> QuantConnect.Util.ExpressionBuilder.OfType< T > |
( |
this Expression |
expression | ) |
|
|
static |
Returns all the expressions of the specified type in the given expression tree
- Template Parameters
-
T | The type of expression to search for |
- Parameters
-
expression | The expression to search |
- Returns
- All expressions of the given type in the specified expression
Definition at line 110 of file ExpressionBuilder.cs.
◆ Single< T >() [1/2]
static T QuantConnect.Util.ExpressionBuilder.Single< T > |
( |
this Expression |
expression | ) |
|
|
static |
Returns the single expression of the specified type or throws if none or more than one expression of the specified type is contained within the expression.
- Template Parameters
-
T | The type of expression to search for |
- Parameters
-
expression | The expression to search |
- Returns
- Expression of the specified type
Definition at line 123 of file ExpressionBuilder.cs.
◆ Single< T >() [2/2]
static T QuantConnect.Util.ExpressionBuilder.Single< T > |
( |
this IEnumerable< Expression > |
expressions | ) |
|
|
static |
Returns the single expression of the specified type or throws if none or more than one expression of the specified type is contained within the expression.
- Template Parameters
-
T | The type of expression to search for |
- Parameters
-
expressions | The expressions to search |
- Returns
- Expression of the specified type
Definition at line 136 of file ExpressionBuilder.cs.
The documentation for this class was generated from the following file: