Show / Hide Table of Contents

Class ExpressionFuncTExtensions

Extension methods for Expression<TDelegate> of Func<TResult> and Func<T, TResult>.

Inheritance
object
ExpressionFuncTExtensions
object.Equals(object)
object.Equals(object, object)
object.GetHashCode()
object.GetType()
object.MemberwiseClone()
object.ReferenceEquals(object, object)
object.ToString()
Namespace: Sartorius.SAF.Extensions
Assembly: Sartorius.SAF.dll
Syntax
public static class ExpressionFuncTExtensions

Methods

View Source

GetPropertyInfo<T>(Expression<Func<T>>)

Gets the PropertyInfo of the property that is defined within the propertyExpression.

Declaration
public static PropertyInfo GetPropertyInfo<T>(this Expression<Func<T>> propertyExpression)
Parameters
Type Name Description
Expression<Func<T>> propertyExpression

The property expression.

Returns
Type Description
PropertyInfo

The PropertyInfo.

Type Parameters
Name Description
T

The type of the property.

Exceptions
Type Condition
ArgumentException

propertyExpression.Body is not of type 'MemberExpression'. or Member defined in the propertyExpression is no property

View Source

GetPropertyName<T>(Expression<Func<T>>)

Gets the name of the property.

Declaration
public static string GetPropertyName<T>(this Expression<Func<T>> propertyExpression)
Parameters
Type Name Description
Expression<Func<T>> propertyExpression

The property expression.

Returns
Type Description
string

the property name as string

Type Parameters
Name Description
T

The result of the expression (the property type).

View Source

GetPropertyName<T, TResult>(Expression<Func<T, TResult>>)

Gets the name of a property from an expression.

Declaration
public static string GetPropertyName<T, TResult>(this Expression<Func<T, TResult>> propertyExpression)
Parameters
Type Name Description
Expression<Func<T, TResult>> propertyExpression

The property expression.

Returns
Type Description
string

The property name as string

Type Parameters
Name Description
T

The type of the object root of the expression.

TResult

The result of the expression (the property type).

Examples
  • View Source
Back to top Generated by DocFX