I have a table Companies
CompanyId
CountryId
and so on...
And then have a list of objects with following structure (let's name this list dataset)
Id
CountryId
CurrencyId
TotalCost
and so on...
and what I'm trying to do is to get all companies which exists in above dataset, so I'm trying to write query like:
IEnumerable<Company> companies = db.Companies.Where(a=a.CompanyId == dataset.Select(a=>a.CompanyId).ToList()
but it gives me an error,
Operator '==' cannot be applied to operands of typ int and List
How to get rid of this error?