❔ Need help with a LINQ query
Hi,
I could use a bit of help building a LINQ query.
Assume a simple entity like this:
Then you have an IEnumerable<Event>. From this collection I want to extract all customer ids that only have eventTypeId == 1 associated with them.
So if there are two events for one customerId, and those two eventTypeIds are 1 and 2 then I don't want that associated customer id.
If both eventTypeIds are 1 then I want that specific customerId. Does that make sense?
Currently I have this
But looking at it it doesn't really make sense. And it doesn't return what I thought it would. Any ideas?
I could use a bit of help building a LINQ query.
Assume a simple entity like this:
Then you have an IEnumerable<Event>. From this collection I want to extract all customer ids that only have eventTypeId == 1 associated with them.
So if there are two events for one customerId, and those two eventTypeIds are 1 and 2 then I don't want that associated customer id.
If both eventTypeIds are 1 then I want that specific customerId. Does that make sense?
Currently I have this
But looking at it it doesn't really make sense. And it doesn't return what I thought it would. Any ideas?