我试图加入那些表我必须使用动态 linq,如果.Join(dbcontext.Providers)有并且当我在.Join(dbcontext.Providers)上没有数据时返回数据 所有queryResolts returnig 0结果
即使其中一个连接返回 0 结果,我如何获取数据
var queryResolts = dbcontext.Tracks
// Add Services
.Join(dbcontext.Services,
track => track.ServiceId,
service => service.ServiceId,
(track, service) => new { Track = track, Service = service })
// Add ServiceInterfaces
.Join(dbcontext.ServiceInterfaces,
ts => ts.Track.ServiceInterfaceId,
serviceInterface => serviceInterface.ServiceInterfaceId,
(ts, serviceInterface) => new { Track = ts.Track, Service = ts.Service, ServiceInterfaces = serviceInterface })
// Add Providers
.Join(dbcontext.Providers,
tss => tss.Track.ProviderId,
provider => provider.ProviderId,
(tss, provider) => new { Track = tss.Track, Service = tss.Service, ServiceInterfaces = tss.ServiceInterfaces, Providers = provider })
.Where("ServiceInterfaces.ServiceInterfaceName == @0", "PublishPolicyInterface2")
.Select(y => y.Track)
;
谢谢
三木