EntitySet<TEntity>.CopyTo(TEntity[], Int32) EntitySet<TEntity>.CopyTo(TEntity[], Int32) EntitySet<TEntity>.CopyTo(TEntity[], Int32) EntitySet<TEntity>.CopyTo(TEntity[], Int32) Method

定義

EntitySet<TEntity> を配列にコピーします。Copies the EntitySet<TEntity> to an array.

public:
 virtual void CopyTo(cli::array <TEntity> ^ array, int arrayIndex);
public void CopyTo (TEntity[] array, int arrayIndex);
abstract member CopyTo : 'Entity[] * int -> unit
override this.CopyTo : 'Entity[] * int -> unit
Public Sub CopyTo (array As TEntity(), arrayIndex As Integer)

パラメーター

array
TEntity[]

コピー先の配列。The array to copy to.

arrayIndex
Int32 Int32 Int32 Int32

配列内の開始インデックス。The starting index in the array.

注釈

次の C# のサンプルは、このメソッドの 1 つの使用を示しています。The following C# sample shows one use of this method:

var customer = (from c in db.Customers  
   where c.CustomerID == "ALFKI"  
   select c).Single();  

Order[] orderArray = new Order[customer.Orders.Count];  

customer.Orders.CopyTo(orderArray,0);In Visual Basic:customer.Orders.CopyTo(orderArray,0);In Visual Basic:

Dim customer = (From c In db.Customers _   
   Where c.CustomerID = "ALFKI" _   
   Select c).[Single]()  

Dim orderArray As Order() = New Order(customer.Orders.Count - 1) {}  
customer.Orders.CopyTo(orderArray, 0)  

適用対象