Here is a little example to doing multple joins using LINQ with EF:
var query = context.EquipmentBases
.Where(e => e.Model == model && e.Serial == serial && e.Suffix == suffix)
.Join(context.TruckBases, e=>e.EquipmentBaseID, t =>t.EquipmentBaseFK, (e,t)=>new{e,t})
.Join(context.TruckSupplemental_Hitch, et=>et.t.TruckID, h=>h.TruckFK, (et,h)=>new{et,h})
.Join(context.TrailerPlugTypeLTs, eth=>eth.et.t.TrailerPlugTypeFK, p=>p.ID, (eth, p)=>new{eth,p})
.Select(r => new { r.eth.et.e.CurbWeight, r.eth.et.e.MaxLoad, r.eth.h.BallRating, r.eth.h.ReceiverRating, r.eth.h.BallSize, r.eth.et.e.GVWR, r.eth.h.BallHeight, r.eth.et.t.IntegratedHitchSystem, r.p.TrailerPlugType });
Note the pattern in the joins. This is what makes it all work.
Little short but very helpful it is!
LikeLike
Hi there! This post couldn’t be written any better! Reading through this post reminds me of my previous room mate! He always kept talking about this. I will forward this page to him. Pretty sure he will have a good read. Thank you for sharing!
LikeLike
I read this piece of writing completely concerning the difference of latest and preceding technologies, it’s awesome article.
LikeLike
For most up-to-date news you have to pay a visit internet and on the web I found this web site as a most excellent web page for latest updates.
LikeLike
I love your blog.. very nice colors & theme. Did you make this website yourself or did you hire someone to do it for you? Plz respond as I’m looking to design my own blog and would like to find out where u got this from. many thanks
LikeLike