Expression.ListBind Method (MemberInfo, IEnumerable<ElementInit>)

 
System_CAPS_noteNote

The .NET API Reference documentation has a new home. Visit the .NET API Browser on docs.microsoft.com to see the new experience.

Creates a MemberListBinding where the member is a field or property.

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

public static MemberListBinding ListBind(
	MemberInfo member,
	IEnumerable<ElementInit> initializers
)

Parameters

member
Type: System.Reflection.MemberInfo

A MemberInfo that represents a field or property to set the Member property equal to.

initializers
Type: System.Collections.Generic.IEnumerable<ElementInit>

An IEnumerable<T> that contains 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 and the Member and Initializers properties set to the specified values.

Exception Condition
ArgumentNullException

member is null.

-or-

One or more elements of initializers are null.

ArgumentException

member does not represent a field or property.

-or-

The FieldType or PropertyType of the field or property that member represents does not implement IEnumerable.

Universal Windows Platform
Available since 8
.NET Framework
Available since 3.5
Portable Class Library
Supported in: portable .NET platforms
Silverlight
Available since 2.0
Windows Phone Silverlight
Available since 7.0
Windows Phone
Available since 8.1
Return to top
Show: