I have two list :
public IEnumerable A{ get; set; }
public IEnumerable B{ get; set; }
i want C to be a combination of both A and B.
public IEnumerable C{ get; set; }
how can this be done? thank you in advance :)
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.


public static IEnumerable SmartCombine(IEnumerable fallback, IEnumerable translated) { return translated.Concat(fallback.Where(p => !translated.Any(x => x.id.equals(p.id))); } 
public void Linq94() { int[] numbersA = { 0, 2, 4, 5, 6, 8, 9 }; int[] numbersB = { 1, 3, 5, 7, 8 }; var allNumbers = numbersA.Concat(numbersB); Console.WriteLine("All numbers from both arrays:"); foreach (var n in allNumbers) { Console.WriteLine(n); } }
var together = first.Concat(second);
Tapan PatelPosted Oct 3, 2016, 9:24 AM