c# - How to find out if there are any duplicates in one list versus another? -


I have a list where a property of Myclass is 'name'. I want to know that duplicates with the same name in the list Myclass is.

In addition, I have a separate list and I want to know whether there is a duplicate in comparison to List A or not.

To answer the first question

I want to know Whether the duplicate is the list with the same name in the Myclass.

You can do this:

  boolHyplicates = List A. Calculation! = Listings Select (C = & gt; c.Name) .Distinct () Count ();  

In response to another question

In addition, I have a separate list and I want to know that there is no duplicate compared to List A I

You can:

  bool headlinks = separate list Select (c = & gt; c.Name). Sort (Select List (c = & gt; C.Name)). anyone ();  

Comments

Popular posts from this blog

asp.net - Javascript/DOM Why is does my form not support submit()? -

sockets - Delphi: TTcpServer, connection reset when reading -

javascript - Classic ASP "ExecuteGlobal" statement acting differently on two servers -