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.


var together = first.Concat(second);
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); } }

public static IEnumerable SmartCombine(IEnumerable fallback, IEnumerable translated) { return translated.Concat(fallback.Where(p => !translated.Any(x => x.id.equals(p.id))); }Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend5days leftRegister
Tapan PatelRank #614 · 3.9K reputationPosted Oct 3, 2016, 5:24 AM EDT