1
Answer

Contains performance

Sanjay Sharma

Sanjay Sharma

5y
548
1
Hi,
 
I have following code
 
int [] selectedPocilies = {1,2,3,...................10000};
var PolicyData = commonDAL.GetPolicyData(); // policy records
//Below statement took time
var FilteredPolicyData = PolicyData.Where(p => SelectedPolicies.Contains(p.PolicyId)).ToList();
 
Is there anyway to reframe above code line.
Thanks in advance
Answers (1)