Hi
i have a List<my_Custom_Class> and List<string>
. My custom class has various items in which one is DCN number and list<string>
contains only DCN number. So I need to check the List<Custom_Class> contains any dcn from List<string>.
For example suppose List1 = List<Custom_Class> and List2 = List<String>
. If List1 has 2000 items and list2 has 40000 items on which 600 items from List1 exists in List2. So in this case i need 1400 as my output List as list1. So what would be the expression.
Also one more case is here since List1 contains various items , other items values might be different but the DCN must be same. That I need to check only the similarity of DCN.
Below is my class. Now from datatable i am adding DCN to a List<String> Dcns;
public class DocumentInfo
{
public string ImageType { get; set; }
public string FileFullPath { get; set; }
public string BatchName { get; set; }
public string FileName { get; set; }
public string DCN { get; set; }
public string MemberID { get; set; }
public string NPI { get; set; }
public string TaxID { get; set; }
public string Client { get { return DCN.Substring(0, 2); } }
}
So here in my case I have 493K DCNS in List<string>Dcns and 110K DCNS in List<DocumentInfo>
. I need to filter the duplicates records from 110K DCNs. Or can say substract the two list. I need to remove all duplicate dcns that exists in List. Say If 70K records are duplicate then my resultant list of document info will be of List of rest 40K. Distinct/Except is not working. LINQ/ Lambda Exp will be preferrable.
I need it urgently and ASAP.
Thanks in adv.