i want to Group a List of Mails to their recipients.
The lstMails List is a List<MailModel>
MailModel has a Property which is string[] To.
for example there could be 5 mails in this List.
- Mail1.To = ["nico.test@test.de"]
- Mail2.To = ["nico.test@test.de", "nico.frank@test.de"]
- Mail3.To = ["nico.jeff@test.de"]
- Mail4.To = ["nico.star@test.de", "nico.frank@test.de"]
- Mail5.To = ["nico.jeff@test.de"]
i would like to get a list for each Mail Recipient.
So for example
- "lstNicoTest" = [ Mail1, Mail2 ]
- "lstNicoJeff" = [ Mail3, Mail5 ]
- "lstNicoFrank" = [ Mail2, Mail4 ]
- "lstNicoStar" = [ Mail5 ]
at best it would be a ForEach(List<MailModel> list in lstMails.GroupBy(-----))
i dont know i have been googling around, but the problem is if i Group By it only checks if arrays are the Same, basicly if .To is ["reci1", "reci"] == ["reci1", "reci"] it doesnt not "copy" them basicly
if i did not provide sufficent information im sorry, im here to edit..