Class ExpressionTDelegateEx
Class containing some extension methods for System.Linq.Expressions.Expression<TDelegate>.
Inheritance
System.Object
ExpressionTDelegateEx
Inherited Members
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.ToString()
Namespace:Extend
Assembly:Extend.dll
Syntax
public static class ExpressionTDelegateEx
Methods
| Improve this Doc View SourceGetMemberInfoFromExpression<TDeclairingType, TMember>(Expression<Func<TDeclairingType, TMember>>)
Gets the member info of from the given member expression.
Declaration
public static MemberInfo GetMemberInfoFromExpression<TDeclairingType, TMember>(this Expression<Func<TDeclairingType, TMember>> expression)
Parameters
Type | Name | Description |
---|---|---|
System.Linq.Expressions.Expression<TDelegate><System.Func<T, TResult><TDeclairingType, TMember>> | expression | The member expression. |
Returns
Type | Description |
---|---|
System.Reflection.MemberInfo | Returns the member info from the given expression, or null if the expression is not valid. |
Type Parameters
Name | Description |
---|---|
TDeclairingType | The type of the declaring type. |
TMember | The type of the member. |
Remarks
Contains logic to work with unary expressions: E.g. to work with expressions containing a Convert node.
Exceptions
Type | Condition |
---|---|
System.ArgumentNullException | expression can not be null. |
GetMemberPath<TDeclaringType, TMember>(Expression<Func<TDeclaringType, TMember>>)
Gets a dotted path of property names representing the property expression. E.g. Parent.Child.Sibling.Name.
Declaration
public static string GetMemberPath<TDeclaringType, TMember>(this Expression<Func<TDeclaringType, TMember>> expression)
Parameters
Type | Name | Description |
---|---|---|
System.Linq.Expressions.Expression<TDelegate><System.Func<T, TResult><TDeclaringType, TMember>> | expression | The expression pointing to the member. |
Returns
Type | Description |
---|---|
System.String |
Type Parameters
Name | Description |
---|---|
TDeclaringType | |
TMember |
Exceptions
Type | Condition |
---|---|
System.ArgumentNullException | expression can not be null. |