hey all. Just wanting to know is this the most efficient way of getting values from a db: given;
----------- --------------- -------------
| Channel | |Issue | |Topic |
| path(ck)| |channelID(fk)| |issueID(fk)|
----------- --------------- -------------
- One channel has many Issues
- One Issue has many Topics
- path is an alternate key
I have written the following linq statment.
var content = (from c in db.Channels
where c.channel_holding_page == path
select new { c, _latestIssue = c.Issues.OrderBy(i => i.issue_created).Where(i => i.issue_isVisible == true).FirstOrDefault(), _topics = c.Issues.OrderBy(i => i.issue_created).Where(i => i.issue_isVisible == true).FirstOrDefault().Topics }).FirstOrDefault();
I want to get(working backwards here) all the topics associated with the latest issue(issue_created) that is set to be public(issue_isVisible) from said channel.
Is this the most efficient way or is there a method that would be quicker then this.