I am looking for a more efficient way to do this...(see below)... I have to perform it seven times as I have seven feature articles. The id I am feeding off is the page id (aka featurearticles.fk_pageID_item1 featurearticles.fk_pageID_item2).
I am ok with doing a table join and not selecting * as it were. I am also ok with making a temporary object to hold information.
DataAccess.Page pgf1 = (from p in db.Pages
where p.pageID == featurearticles.fk_pageID_item1
select p).FirstOrDefault();
PageArticle paf1 =(from pa in db.PageArticles
where pa.page_art_pageID == pgf1.pageID &&
pa.page_art_isCurrent ==true
select pa).FirstOrDefault();
Article af1 = (from a in db.Articles
where a.articleID == paf1.page_art_articleID
select a).FirstOrDefault();
- gets a page.
- gets the current version.
- gets the info for that version.
I am stuck with this table layout.
Thanks.