How to remove duplicates from collection using IEqualityComparer, LinQ Distinct

前端 未结 6 1858
梦如初夏
梦如初夏 2020-12-05 04:36

I am unable to remove the duplicates from collection , i have implemented IEqualityComparer for the class Employee still i am not getting the output

static v         


        
6条回答
  •  囚心锁ツ
    2020-12-05 04:55

    Here is a good tutorial

        public int GetHashCode(Employe obj)
        {
            return obj.fname.GetHashCode() ^ obj.lname.GetHashCode();
        }
    

提交回复
热议问题