-
-
Save SelvinPL/896766c603157749cf478ccda07b38db to your computer and use it in GitHub Desktop.
SO59303710
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 result = paymentCollections | |
.GroupBy(l => | |
{ | |
switch(l.PaymentStatus) | |
{ | |
case "Status1": | |
return "Unit1"; | |
case "Status2": | |
case "Status3": | |
return "Unit2"; | |
case "Status4": | |
return "Unit3"; | |
case "Status5": | |
case "Status6": | |
return "Unit4"; | |
} | |
return "Unk"; | |
}) | |
.Select(cl => new MoneyMovement | |
{ | |
CollectionUnit = cl.Key, | |
MoneyCollected = cl.Sum(c => c.Amount).ToString(), | |
NoOfReceipt = cl.Count().ToString(), | |
}).ToList(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment