Utility class to assist with dealing with expressions.
More...
|
static string | GetMemberPathFor< TSource > (Expression< Func< TSource, object > > expression) |
| Calculates the member path of an Expression and returns it as a dotted string.
|
static Type | GetPropertyTypeFor< TSource > (Expression< Func< TSource, object > > expression) |
| Gets the type of the property referred to by an expression.
|
static string | GetFullPropertyPathNameFrom (MemberExpression expression) |
| Calculates the member path of an Expression and returns it as a dotted string.
|
Utility class to assist with dealing with expressions.
◆ GetFullPropertyPathNameFrom()
string PeanutButter.Utils.ExpressionUtil.GetFullPropertyPathNameFrom |
( |
MemberExpression | expression | ) |
|
|
static |
Calculates the member path of an Expression and returns it as a dotted string.
- Parameters
-
expression | Subject Expression to operate on |
- Returns
- (Dotted) string representing the path in the expression
- for example, the expression o => o.Foo.Bar will return "Foo.Bar"
◆ GetMemberPathFor< TSource >()
string PeanutButter.Utils.ExpressionUtil.GetMemberPathFor< TSource > |
( |
Expression< Func< TSource, object > > | expression | ) |
|
|
static |
Calculates the member path of an Expression and returns it as a dotted string.
- Parameters
-
expression | Subject Expression to operate on |
- Template Parameters
-
TSource | Type of the source object for the expression |
- Returns
- (Dotted) string representing the path in the expression
- for example, the expression o => o.Foo.Bar will return "Foo.Bar"
- Exceptions
-
Exception | Exceptions are thrown when the Expression cannot be grokked. The Exception message will explain why. |
◆ GetPropertyTypeFor< TSource >()
Type PeanutButter.Utils.ExpressionUtil.GetPropertyTypeFor< TSource > |
( |
Expression< Func< TSource, object > > | expression | ) |
|
|
static |
Gets the type of the property referred to by an expression.
- Parameters
-
expression | Subject expression to operate on |
- Template Parameters
-
TSource | Type of the source object of the expression |
- Returns
- The type of the property referred to in the expression. For example, o => o.Name would probably return string
The documentation for this class was generated from the following file:
- source/Utils/PeanutButter.Utils/ExpressionUtil.cs