Show / Hide Table of Contents

Class ExpressionExtensions

Extensions for System.Linq.Expressions.Expression<> class.

Inheritance
System.Object
ExpressionExtensions
Namespace: MAT.Atlas.Api.Core.Extensions
Assembly: MAT.Atlas.Api.Core.dll
Syntax
public static class ExpressionExtensions : Object

Methods

GetPropertyInfo<TSource, TProperty>(Expression<Func<TSource, TProperty>>)

Gets the property information from the lambda expression.

Declaration
public static PropertyInfo GetPropertyInfo<TSource, TProperty>(this Expression<Func<TSource, TProperty>> propertyExpression)
Parameters
Type Name Description
System.Linq.Expressions.Expression<System.Func<TSource, TProperty>> propertyExpression

Lambda expression, which defines the property.

Returns
Type Description
System.Reflection.PropertyInfo

The System.Reflection.PropertyInfo instance, which describes the property.

Type Parameters
Name Description
TSource

The type the property belongs to.

TProperty

The type of the property.

Exceptions
Type Condition
System.ArgumentException

Thrown, when the expression does not define a property or is from a wrong class.

In This Article
Back to top Generated by DocFX