Click or drag to resize
ReflectionHelperGetPropertyTOwner, TProperty Method

Namespace: Lawo.Reflection
Assembly: Lawo (in Lawo.dll) Version: 1.4.1707.27006
Syntax
C#
public static IProperty<TOwner, TProperty> GetProperty<TOwner, TProperty>(
	this TOwner owner,
	Expression<Func<TOwner, TProperty>> getPropertyExpression
)

Parameters

owner
Type: TOwner
The owner object.
getPropertyExpression
Type: System.Linq.ExpressionsExpressionFuncTOwner, TProperty
An expression calling the getter of a property, for example s => s.Length.

Type Parameters

TOwner
The type of owner.
TProperty
The type of the property identified by getPropertyExpression.

Return Value

Type: IPropertyTOwner, TProperty

Usage Note

In Visual Basic and C#, you can call this method as an instance method on any object of type . When you use instance method syntax to call this method, omit the first parameter. For more information, see Extension Methods (Visual Basic) or Extension Methods (C# Programming Guide).
Exceptions
ExceptionCondition
ArgumentExceptionThe expression passed for getPropertyExpression does not return the value of a property.
ArgumentNullExceptionowner and/or getPropertyExpression equal null.
See Also