I'm little bit new to Entity Framework Core v2.1, and my problem is as below.
In my case there is a table called ServiceCarrier like this:
ServiceId CarrierId
-------------------
1 1
2 1
4 1
1 2
2 2
5 2
1 20028
2 20028
5 20028
By using this SQL query, I was able to get the result set needed:
SELECT serviceid
FROM T
GROUP BY serviceid
WHERE carrierid IN (1, 20028)
HAVING count(*) = (SELECT COUNT(DISTINCT carrierid)
FROM T
WHERE carrierid IN (1, 20028));
Results:
ServiceId
---------
1
2
And I want to convert it to Entity Framework Core 2.1.
Appreciate your help in advance.