Skip to content
Loading
  • Abhilash J A
    +1
    Hello Shosho S,
    Try this,
    public IEnumerable A { get; set; }
    public IEnumerable B { get; set; }
    public IEnumerable C { get; set; }
    public IEnumerable get()
    {
    return C = A.Concat(B);
    }
    +1
  • Delpin Susai Raj
    +1
    Code
    var together = first.Concat(second);
    +1
  • Delpin Susai Raj
    +1
    C#
    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); } }
    +1
  • +1
    public void AutomateSourceToTargetStripMenuItem_Click()
    {
    SQL_Light_Exce_lOperations.DataTableDisplay obj = new DataTableDisplay();
    sourcemethod();
    targetmethod();
    }
    every method is void based methods here. so, we could not change all methods as a other methods except void. So, please help me regarding on this.
    +1
  • Hussain Patel
    +1
    Here's the sample program to combine IEnumerable list A and B in to C..
    Hope this helps.
    1. usingSystem;
    2. usingSystem.Collections.Generic;
    3. usingSystem.Linq;
    4. usingSystem.Text;
    5. usingSystem.Threading.Tasks;
    6. namespaceConsoleApplication1
    7. {
    8. classProgram
    9. {
    10. staticvoidMain(string[]args)
    11. {
    12. foof1=newfoo();
    13. f1.a=newList<int>(){1,2,3};
    14. f1.b=newList<int>(){4,6,6};
    15. f1.c=f1.a.Concat(f1.b).ToList();
    16. foreach(intiinf1.c)
    17. {
    18. Console.WriteLine(i.ToString());
    19. }
    20. Console.Read();
    21. }
    22. }
    23. publicclassfoo
    24. {
    25. publicIEnumerable<int>a{get;set;}
    26. publicIEnumerable<int>b{get;set;}
    27. publicIEnumerable<int>c{get;set;}
    28. }
    29. }
    +1
  • Delpin Susai Raj
    0
    Code
    public static IEnumerable SmartCombine(IEnumerable fallback, IEnumerable translated) { return translated.Concat(fallback.Where(p => !translated.Any(x => x.id.equals(p.id))); }
    0