Редагувати

Поділитися через


Expression.ListBind Method

Definition

Creates a MemberListBinding object.

Overloads

ListBind(MethodInfo, ElementInit[])

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

ListBind(MethodInfo, IEnumerable<ElementInit>)

Creates a MemberListBinding based on a specified property accessor method.

ListBind(MemberInfo, IEnumerable<ElementInit>)

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

ListBind(MemberInfo, ElementInit[])

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

ListBind(MethodInfo, ElementInit[])

Source:
MemberListBinding.cs
Source:
MemberListBinding.cs
Source:
MemberListBinding.cs

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

public:
 static System::Linq::Expressions::MemberListBinding ^ ListBind(System::Reflection::MethodInfo ^ propertyAccessor, ... cli::array <System::Linq::Expressions::ElementInit ^> ^ initializers);
public static System.Linq.Expressions.MemberListBinding ListBind (System.Reflection.MethodInfo propertyAccessor, params System.Linq.Expressions.ElementInit[] initializers);
static member ListBind : System.Reflection.MethodInfo * System.Linq.Expressions.ElementInit[] -> System.Linq.Expressions.MemberListBinding
Public Shared Function ListBind (propertyAccessor As MethodInfo, ParamArray initializers As ElementInit()) As MemberListBinding

Parameters

propertyAccessor
MethodInfo

A MethodInfo that represents a property accessor method.

initializers
ElementInit[]

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

Returns

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.

Exceptions

propertyAccessor is null.

-or-

One or more elements of initializers are null.

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.

Applies to

ListBind(MethodInfo, IEnumerable<ElementInit>)

Source:
MemberListBinding.cs
Source:
MemberListBinding.cs
Source:
MemberListBinding.cs

Creates a MemberListBinding based on a specified property accessor method.

public:
 static System::Linq::Expressions::MemberListBinding ^ ListBind(System::Reflection::MethodInfo ^ propertyAccessor, System::Collections::Generic::IEnumerable<System::Linq::Expressions::ElementInit ^> ^ initializers);
public static System.Linq.Expressions.MemberListBinding ListBind (System.Reflection.MethodInfo propertyAccessor, System.Collections.Generic.IEnumerable<System.Linq.Expressions.ElementInit> initializers);
static member ListBind : System.Reflection.MethodInfo * seq<System.Linq.Expressions.ElementInit> -> System.Linq.Expressions.MemberListBinding
Public Shared Function ListBind (propertyAccessor As MethodInfo, initializers As IEnumerable(Of ElementInit)) As MemberListBinding

Parameters

propertyAccessor
MethodInfo

A MethodInfo that represents a property accessor method.

initializers
IEnumerable<ElementInit>

An IEnumerable<T> that contains ElementInit objects to use to populate the Initializers collection.

Returns

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.

Exceptions

propertyAccessor is null.

-or-

One or more elements of initializers are null.

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.

Applies to

ListBind(MemberInfo, IEnumerable<ElementInit>)

Source:
MemberListBinding.cs
Source:
MemberListBinding.cs
Source:
MemberListBinding.cs

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

public:
 static System::Linq::Expressions::MemberListBinding ^ ListBind(System::Reflection::MemberInfo ^ member, System::Collections::Generic::IEnumerable<System::Linq::Expressions::ElementInit ^> ^ initializers);
public static System.Linq.Expressions.MemberListBinding ListBind (System.Reflection.MemberInfo member, System.Collections.Generic.IEnumerable<System.Linq.Expressions.ElementInit> initializers);
static member ListBind : System.Reflection.MemberInfo * seq<System.Linq.Expressions.ElementInit> -> System.Linq.Expressions.MemberListBinding
Public Shared Function ListBind (member As MemberInfo, initializers As IEnumerable(Of ElementInit)) As MemberListBinding

Parameters

member
MemberInfo

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

initializers
IEnumerable<ElementInit>

An IEnumerable<T> that contains ElementInit objects to use to populate the Initializers collection.

Returns

A MemberListBinding that has the BindingType property equal to ListBinding and the Member and Initializers properties set to the specified values.

Exceptions

member is null.

-or-

One or more elements of initializers are null.

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.

Applies to

ListBind(MemberInfo, ElementInit[])

Source:
MemberListBinding.cs
Source:
MemberListBinding.cs
Source:
MemberListBinding.cs

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

public:
 static System::Linq::Expressions::MemberListBinding ^ ListBind(System::Reflection::MemberInfo ^ member, ... cli::array <System::Linq::Expressions::ElementInit ^> ^ initializers);
public static System.Linq.Expressions.MemberListBinding ListBind (System.Reflection.MemberInfo member, params System.Linq.Expressions.ElementInit[] initializers);
static member ListBind : System.Reflection.MemberInfo * System.Linq.Expressions.ElementInit[] -> System.Linq.Expressions.MemberListBinding
Public Shared Function ListBind (member As MemberInfo, ParamArray initializers As ElementInit()) As MemberListBinding

Parameters

member
MemberInfo

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

initializers
ElementInit[]

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

Returns

A MemberListBinding that has the BindingType property equal to ListBinding and the Member and Initializers properties set to the specified values.

Exceptions

member is null.

-or-

One or more elements of initializers are null.

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.

Applies to