How to compare two class type lists

Discussion in 'Programming' started by diyaots, Sep 24, 2012.

  1. #1
    Hi friends
    Please helping me out, I m working in .net development so i m facing this problem that How to compare two class type lists:-

    I have below lists

    List<Myclass> obj1 = List<Myclass>();
    List<Myclass> obj2 = List<Myclass>();

    obj1= method1();
    obj2= method2();

    Now I want to check whether both the list are equal or not, in other words whether both lists contains same data.
    Please provide me the

    Thanks
    Diya
     
    diyaots, Sep 24, 2012 IP
  2. Hack2star

    Hack2star Member

    Messages:
    148
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    26
    As Seller:
    100% - 0
    As Buyer:
    100% - 0
    #2
    if (object1.GetHashCode = object2.GetHashCode){

    }

    End IF
     
    Hack2star, Sep 25, 2012 IP