Avatar of Dinesh Kumar
Dinesh Kumar
Flag for India asked on

Filtering C# lambda

Hello Experts,
Following code passes EmployeeNumber one by one and if that is found in the  internalEmployeelist
then that does not become part of results.
results=results.Where(itm => !IsInternalemployee(itm.EmployeeNumber));  //results is iqueryable
private bool IsInternalemployee(String itm)
{
  return internalEmployeelist.Contains(itm) ? true : false; //internalEmployeelist is list<String>
}

Open in new window

Please help in  providing some better way of doing it. please note that results is iqueryable while internalEmployeelist is just list<String>
C#ASP.NET.NET Programming

Avatar of undefined
Last Comment
Dinesh Kumar

8/22/2022 - Mon
ASKER CERTIFIED SOLUTION
Karrtik Iyer

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
Dinesh Kumar

ASKER
I was looking for lesser code so your solution works for me.

Thank you.
This is the best money I have ever spent. I cannot not tell you how many times these folks have saved my bacon. I learn so much from the contributors.
rwheeler23