Is it possible to replace the foreach statement with a Linq command?
string recipient = "recipients could not be defined";
if (mail.To != null && mail.To.Count > 0) {
var addresses = mail.To.Select(r => r.Address);
foreach (string s in addresses) {
recipient += s + " ";
}
}
If I had ReSharper then I'm sure it would have come up with an appropriate suggestion but I don't. This question uses Concat and that feels like it should help but I'm not certain as to what object to use in the Concat.