0
我嘗試加入這些表我必須使用動態LINQ, 它`做工精細,如果。加入(dbcontext.Providers)具有和返回數據 時,我沒有對數據。加入(dbcontext.Providers)所有queryResolts returnig 0結果乘加入動態LINQ
我怎樣才能得到數據的連接返回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)
;
感謝
三木
看起來這裏的兩個連接完全沒用。你想做什麼? –