Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

240
Vistas
C#7 tuple & async

Old format:

private async Task<Tuple<SomeArray[], AnotherArray[], decimal>>         
GetInvoiceDetailAsync(InvoiceHead invoiceHead) { ... }

How can you do that in C#7 with new tuples format?

about 4 years ago · Santiago Trujillo
1 Respuestas
Responde la pregunta

0

Step 1: add the ValueTuple nuget package to your project.

Step 2: as Lucas says in his comment, change the syntax to:

private async Task<(SomeArray[], AnotherArray[], decimal)>GetInvoiceDetailAsync(
    InvoiceHead invoiceHead) 
{ 
    ...
    return (x, y, z); 
}

Note though that you can also then add names to those tuple items, along the lines of:

private async Task<(SomeArray[] x, AnotherArray[] y, decimal z)>GetInvoiceDetailAsync(
    InvoiceHead invoiceHead) 
{ 
    ... 
    return (x, y, z); 
}

And you can then access them as those names, rather than Item1, Item2 and Item3.

about 4 years ago · Santiago Trujillo Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda