EntitySet<TEntity>.CopyTo(TEntity[], Int32) Método
Definição
Importante
Algumas informações dizem respeito a um produto pré-lançado que pode ser substancialmente modificado antes de ser lançado. A Microsoft não faz garantias, de forma expressa ou implícita, em relação à informação aqui apresentada.
Copia para EntitySet<TEntity> um 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)
Parâmetros
- array
- TEntity[]
O array para copiar.
- arrayIndex
- Int32
O índice inicial no array.
Implementações
Exemplos
O exemplo seguinte mostra uma utilização deste método:
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)