EntitySet<TEntity>.CopyTo(TEntity[], Int32) Méthode
Définition
Important
Certaines informations portent sur la préversion du produit qui est susceptible d’être en grande partie modifiée avant sa publication. Microsoft exclut toute garantie, expresse ou implicite, concernant les informations fournies ici.
Copie le EntitySet<TEntity> dans un tableau.
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)
Paramètres
- array
- TEntity[]
Tableau vers lequel copier.
- arrayIndex
- Int32
Index de départ dans le tableau.
Implémente
Exemples
L’exemple suivant montre une utilisation de cette méthode :
var customer = (from c in db.Customers
where c.CustomerID == "ALFKI"
select c).Single();
var orderArray = new Order[customer.Orders.Count];
customer.Orders.CopyTo(orderArray,0);
Dim customer = (From c In db.Customers _
Where c.CustomerID = "ALFKI" _
Select c).[Single]()
Dim orderArray As New Order(customer.Orders.Count - 1) {}
customer.Orders.CopyTo(orderArray, 0)