Last active
July 18, 2019 19:54
-
-
Save jfbueno/a5ce6743c8a4707782ccc04b29326898 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
IEnumerable<IGrouping<string, Compra>> grupos | |
= Compras.GroupBy(x => x.Cliente); // Como deve ser agrupado | |
foreach(var grupo in grupos) // Coleção de grupos | |
{ | |
WriteLine($"Compras de {grupo.Key}"); | |
foreach(var compra in grupo) // Compras do grupo => IGrouping<string, Compra> | |
{ | |
WriteLine($"\t {compra.Valor:n2}"); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment