Last active
July 18, 2019 19:54
-
-
Save jfbueno/c8d33573416c5bf904d180da85b74c7b 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
var agg = grupos.Select(gp => new | |
{ | |
Cliente = gp.Key, | |
QuantidadeCompras = gp.Count(), | |
MelhorCompra = gp.Max(x => x.Valor), | |
PiorCompra = gp.Min(x => x.Valor), | |
TotalCompras = gp.Sum(x => x.Valor) | |
}); | |
foreach(var elemento in agg) | |
{ | |
WriteLine($"Cliente: {elemento.Cliente}"); | |
WriteLine($"Quantidade de compras: {elemento.QuantidadeCompras}"); | |
WriteLine($"Melhor Compra: {elemento.MelhorCompra}"); | |
WriteLine($"Pior Compra: {elemento.PiorCompra}"); | |
WriteLine($"Total em compras: {elemento.TotalCompras}"); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment