Last active
July 18, 2019 19:54
-
-
Save jfbueno/2e2a7ab9850b6d9f7d8bd3f74ab6e47e 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<int, Compra>> grupos | |
= Compras.GroupBy(compra => compra.Pagamento.Month); // Como deve ser agrupado | |
foreach(var grupo in grupos) // Coleção de grupos | |
{ | |
WriteLine($"Compras pagas no mês de {_dtFormat.GetMonthName(grupo.Key)}"); // Chave do agrupamento | |
foreach(var elemento in grupo) // Compras do grupo => IGrouping<int, Compra> | |
{ | |
WriteLine($"\t{elemento.ToString()}"); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment