Class ExpressionHelper
An expression helper.
Inheritance
Inherited Members
Namespace: Kephas.Data.Client.Queries.Conversion.ExpressionConverters
Assembly: Kephas.Data.Client.dll
Syntax
public static class ExpressionHelper
Methods
| Improve this Doc View SourceGetConvertedValueExpression(Object, Type)
Gets an expression for the value so that it has a compatible type with the member type.
Declaration
public static Expression GetConvertedValueExpression(object value, Type targetType)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Object | value | The value. |
| System.Type | targetType | The target type. |
Returns
| Type | Description |
|---|---|
| System.Linq.Expressions.Expression | The converted value expression. |
GetMethodInfo<T1>(Expression<Func<T1>>)
Gets the method information for the provided function definition.
Declaration
public static MethodInfo GetMethodInfo<T1>(Expression<Func<T1>> expression)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Linq.Expressions.Expression<System.Func<T1>> | expression | A Func{T1} to process. |
Returns
| Type | Description |
|---|---|
| System.Reflection.MethodInfo | The method information. |
Type Parameters
| Name | Description |
|---|---|
| T1 | Generic type parameter T1. |
GetMethodInfo<T1, T2>(Expression<Func<T1, T2>>)
Gets the method information for the provided function definition.
Declaration
public static MethodInfo GetMethodInfo<T1, T2>(Expression<Func<T1, T2>> expression)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Linq.Expressions.Expression<System.Func<T1, T2>> | expression | A Func{T1,T2} to process. |
Returns
| Type | Description |
|---|---|
| System.Reflection.MethodInfo | The method information. |
Type Parameters
| Name | Description |
|---|---|
| T1 | Generic type parameter T1. |
| T2 | Generic type parameter T2. |
GetMethodInfo<T1, T2, T3>(Expression<Func<T1, T2, T3>>)
Gets the method information for the provided function definition.
Declaration
public static MethodInfo GetMethodInfo<T1, T2, T3>(Expression<Func<T1, T2, T3>> expression)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Linq.Expressions.Expression<System.Func<T1, T2, T3>> | expression | A Func{T1,T2,T3} to process. |
Returns
| Type | Description |
|---|---|
| System.Reflection.MethodInfo | The method information. |
Type Parameters
| Name | Description |
|---|---|
| T1 | Generic type parameter T1. |
| T2 | Generic type parameter T2. |
| T3 | Generic type parameter T3. |
GetMethodInfo<T1, T2, T3, T4>(Expression<Func<T1, T2, T3, T4>>)
Gets the method information for the provided function definition.
Declaration
public static MethodInfo GetMethodInfo<T1, T2, T3, T4>(Expression<Func<T1, T2, T3, T4>> expression)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Linq.Expressions.Expression<System.Func<T1, T2, T3, T4>> | expression | A Func{T1,T2,T3,T4} to process. |
Returns
| Type | Description |
|---|---|
| System.Reflection.MethodInfo | The method information. |
Type Parameters
| Name | Description |
|---|---|
| T1 | Generic type parameter T1. |
| T2 | Generic type parameter T2. |
| T3 | Generic type parameter T3. |
| T4 | Generic type parameter T4. |
GetMethodInfo<T1, T2, T3, T4, T5>(Expression<Func<T1, T2, T3, T4, T5>>)
Gets the method information for the provided function definition.
Declaration
public static MethodInfo GetMethodInfo<T1, T2, T3, T4, T5>(Expression<Func<T1, T2, T3, T4, T5>> expression)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Linq.Expressions.Expression<System.Func<T1, T2, T3, T4, T5>> | expression | A Func{T1,T2,T3,T4,T5} to process. |
Returns
| Type | Description |
|---|---|
| System.Reflection.MethodInfo | The method information. |
Type Parameters
| Name | Description |
|---|---|
| T1 | Generic type parameter T1. |
| T2 | Generic type parameter T2. |
| T3 | Generic type parameter T3. |
| T4 | Generic type parameter T4. |
| T5 | Generic type parameter T5. |
NormalizeBinaryExpressionArgs(IList<Expression>)
Normalizes the binary expression arguments.
Declaration
public static IList<Expression> NormalizeBinaryExpressionArgs(IList<Expression> args)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Collections.Generic.IList<System.Linq.Expressions.Expression> | args | The arguments. |
Returns
| Type | Description |
|---|---|
| System.Collections.Generic.IList<System.Linq.Expressions.Expression> | A list of argument expressions. |
Remarks
In comparisons, the client may send mismatched types, mainly due to untyped languages like JavaScript. This method converts the second operand to the type of the member represented by the first operand, so that the comparison does not fail.