im trying to join those tables i have to use dynamic linq,
it`s working fine if the .Join(dbcontext.Providers) has and returning data
when i dont have data on the .Join(dbcontext.Providers) the all queryResolts returnig 0 results
how can i get data even if one of the join returning 0 results
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)
;
thanks
miki
Joinhere works likejoininSQL, it will not return any value if the joined table do not contain result.if your need
left or right outer jointhen useGroupJoin().