Expression.ListBind 方法

定義

建立 MemberListBinding 物件。Creates a MemberListBinding object.

多載

ListBind(MethodInfo, ElementInit[])

根據指定的屬性存取子方法建立 MemberListBinding 物件。Creates a MemberListBinding object based on a specified property accessor method.

ListBind(MethodInfo, IEnumerable<ElementInit>)

根據指定的屬性存取子方法建立 MemberListBindingCreates a MemberListBinding based on a specified property accessor method.

ListBind(MemberInfo, IEnumerable<ElementInit>)

建立 MemberListBinding,其中成員是欄位或屬性。Creates a MemberListBinding where the member is a field or property.

ListBind(MemberInfo, ElementInit[])

建立 MemberListBinding,其中成員是欄位或屬性。Creates a MemberListBinding where the member is a field or property.

ListBind(MethodInfo, ElementInit[])

根據指定的屬性存取子方法建立 MemberListBinding 物件。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

參數

propertyAccessor
MethodInfo

代表屬性存取子方法的 MethodInfoA MethodInfo that represents a property accessor method.

initializers
ElementInit[]

用以填入 ElementInit 集合之 Initializers 物件的陣列。An array of ElementInit objects to use to populate the Initializers collection.

傳回

MemberListBinding

MemberListBinding,其 BindingType 屬性等於 ListBinding,並將 Member 屬性設定為 MemberInfo,表示在 propertyAccessor 中存取的屬性,Initializers 則會填入 initializers 的項目。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.

例外狀況

propertyAccessornullpropertyAccessor is null.

-或--or- initializers 的一個或多個項目為 nullOne or more elements of initializers are null.

propertyAccessor 不代表屬性存取子方法。propertyAccessor does not represent a property accessor method.

-或--or- 屬性 (由 propertyAccessor 存取表示的方法) 的 PropertyType 不會實作 IEnumerableThe PropertyType of the property that the method represented by propertyAccessor accesses does not implement IEnumerable.

適用於

ListBind(MethodInfo, IEnumerable<ElementInit>)

根據指定的屬性存取子方法建立 MemberListBindingCreates 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

參數

propertyAccessor
MethodInfo

代表屬性存取子方法的 MethodInfoA MethodInfo that represents a property accessor method.

initializers
IEnumerable<ElementInit>

IEnumerable<T>,其中包含用以填入 ElementInit 集合的 Initializers 物件。An IEnumerable<T> that contains ElementInit objects to use to populate the Initializers collection.

傳回

MemberListBinding

MemberListBinding,其 BindingType 屬性等於 ListBinding,並將 Member 屬性設定為 MemberInfo,表示在 propertyAccessor 中存取的屬性,Initializers 則會填入 initializers 的項目。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.

例外狀況

propertyAccessornullpropertyAccessor is null.

-或--or- initializers 的一個或多個項目為 nullOne or more elements of initializers are null.

propertyAccessor 不代表屬性存取子方法。propertyAccessor does not represent a property accessor method.

-或--or- 屬性 (由 propertyAccessor 存取表示的方法) 的 PropertyType 不會實作 IEnumerableThe PropertyType of the property that the method represented by propertyAccessor accesses does not implement IEnumerable.

適用於

ListBind(MemberInfo, IEnumerable<ElementInit>)

建立 MemberListBinding,其中成員是欄位或屬性。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

參數

member
MemberInfo

MemberInfo,表示要將 Member 屬性設定為與之相等的欄位或屬性。A MemberInfo that represents a field or property to set the Member property equal to.

initializers
IEnumerable<ElementInit>

IEnumerable<T>,其中包含用以填入 ElementInit 集合的 Initializers 物件。An IEnumerable<T> that contains ElementInit objects to use to populate the Initializers collection.

傳回

MemberListBinding

MemberListBinding,其 BindingType 屬性等於 ListBinding,且 MemberInitializers 屬性設定為指定的值。A MemberListBinding that has the BindingType property equal to ListBinding and the Member and Initializers properties set to the specified values.

例外狀況

membernullmember is null.

-或--or- initializers 的一個或多個項目為 nullOne or more elements of initializers are null.

member 不代表欄位或屬性。member does not represent a field or property.

-或--or- member 所表示之欄位或屬性的 FieldTypePropertyType 不會實作 IEnumerableThe FieldType or PropertyType of the field or property that member represents does not implement IEnumerable.

適用於

ListBind(MemberInfo, ElementInit[])

建立 MemberListBinding,其中成員是欄位或屬性。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

參數

member
MemberInfo

MemberInfo,表示要將 Member 屬性設定為與之相等的欄位或屬性。A MemberInfo that represents a field or property to set the Member property equal to.

initializers
ElementInit[]

用以填入 ElementInit 集合之 Initializers 物件的陣列。An array of ElementInit objects to use to populate the Initializers collection.

傳回

MemberListBinding

MemberListBinding,其 BindingType 屬性等於 ListBinding,且 MemberInitializers 屬性設定為指定的值。A MemberListBinding that has the BindingType property equal to ListBinding and the Member and Initializers properties set to the specified values.

例外狀況

membernullmember is null.

-或--or- initializers 的一個或多個項目為 nullOne or more elements of initializers are null.

member 不代表欄位或屬性。member does not represent a field or property.

-或--or- member 所表示之欄位或屬性的 FieldTypePropertyType 不會實作 IEnumerableThe FieldType or PropertyType of the field or property that member represents does not implement IEnumerable.

適用於