Click or drag to resize

PropertySupportExtractPropertyNameTProperty Method (ExpressionFuncTProperty)

Extracts the property name from a property expression.

Namespace:  TomsToolbox.Essentials
Assembly:  TomsToolbox.Essentials (in TomsToolbox.Essentials.dll)
Syntax
public static string ExtractPropertyName<TProperty>(
	Expression<Func<TProperty>> propertyExpression
)

Parameters

propertyExpression
Type: System.Linq.ExpressionsExpressionFuncTProperty
The property expression (e.g. () => p.PropertyName) to extract the property name from.

Type Parameters

TProperty
The property type.

Return Value

Type: String
The name of the property.
Exceptions
ExceptionCondition
ArgumentExceptionThrown when the expression is:
Not a MemberExpression
The MemberExpression does not represent a property.
See Also