Export (0) Print
Expand All

Expression.ListBind Method (MethodInfo, ElementInit[])

Creates a MemberListBinding object based on a specified property accessor method.

Namespace:  System.Linq.Expressions
Assembly:  System.Core (in System.Core.dll)

public static MemberListBinding ListBind(
	MethodInfo propertyAccessor,
	params ElementInit[] initializers
)

Parameters

propertyAccessor
Type: System.Reflection.MethodInfo

A MethodInfo that represents a property accessor method.

initializers
Type: System.Linq.Expressions.ElementInit[]

An array of ElementInit objects to use to populate the Initializers collection.

Return Value

Type: System.Linq.Expressions.MemberListBinding
A MemberListBinding that has the BindingType property equal to ListBinding, the Member property set to the MemberInfo that represents the property accessed in propertyAccessor, and Initializers populated with the elements of initializers.

ExceptionCondition
ArgumentNullException

propertyAccessor is null.

-or-

One or more elements of initializers is null.

ArgumentException

propertyAccessor does not represent a property accessor method.

-or-

The PropertyType of the property that the method represented by propertyAccessor accesses does not implement IEnumerable.

Windows 7, Windows Vista, Windows XP SP2, Windows Server 2008 R2, Windows Server 2008, Windows Server 2003

The .NET Framework and .NET Compact Framework do not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.

.NET Framework

Supported in: 3.5

Community Additions

ADD
Show:
© 2014 Microsoft