I have a SQL statement that I have checked for function, as this was driving me nuts:
I am trying to create this in Linq(have I got that right?). Something like:
But when I create this, Intellisense cannot find BookingDate within Job and gives me nice red squiggles. Nice if I am wanting to make red squiggles but doesn't help me with what I am trying to do.
Why wont this work?
What is the correct statement?
C#:
SELECT Site.*, Job.*
FROM Site INNER JOIN Job ON Site.SiteID = Job.SiteID
ORDER BY BookingDate;
I am trying to create this in Linq(have I got that right?). Something like:
C#:
[COLOR=blue]var[/COLOR] siteHistory = [COLOR=blue]from[/COLOR] s [COLOR=blue]in[/COLOR] _context.Sites
.Include(w => w.Job)
.OrderBy(w=>w.Job.BookingDate)
[COLOR=blue]select[/COLOR] s;
But when I create this, Intellisense cannot find BookingDate within Job and gives me nice red squiggles. Nice if I am wanting to make red squiggles but doesn't help me with what I am trying to do.
Why wont this work?
What is the correct statement?