更新时间:2022-03-24 23:11:02
我认为您在这里不需要Distinct
,而需要Exists
(或在Linq中称为Any
)
I dont think you need a Distinct
here but a Exists
(or Any
as it is called in Linq)
尝试一下:
var q = (from p in context.Practitioners
where context.ProviderNetworks.Any(pn => pn.ProviderId == p.ProviderId && notNetworkIds.Contains(pn.Network))
orderby p.UpdateDate descending
select p).Skip(PageSize * (pageOffset ?? 0)).Take(PageSize).ToList();