I have a list of objet having "ean" and "eanAlt" properties.
This works:
List<string> eanList = new List<string>();
eanList.AddRange(toGroup.Where(a => a.ean.Length > 0).Select(b => b.ean).ToArray());
eanList.AddRange(toGroup.Where(a => a.eanAlt.Length > 0).Select(b => b.eanAlt).ToArray());
But how can I do it in one query? (I suppose with SelectMany
, but can't find how)