PostTags:
PostTagID (PK)
TagName
PostTagPairs
PostTagPairID (PK)
PostID (FK)
PostTagID (FK)
Posts
PostID (PK)
PostTitle
The following query will return TagName associated with Posts:var myPost = (from bp in db.Posts
where bp.PostID == postId
select new
{
bp.PostTitle,
tags = from p in bp.PostTagPairs select p.PostTag.TagName
}).SingleOrDefault();
Question is how do you get the query above to return PostTagID along with TagName and iterate it in a for loop?
foreach(?? in myPost.tags)
{
??
}
TIA!
ASKER
ASKER
ASKER
ASKER
ASKER
ASKER
ASKER
The .NET Framework is not specific to any one programming language; rather, it includes a library of functions that allows developers to rapidly build applications. Several supported languages include C#, VB.NET, C++ or ASP.NET.
TRUSTED BY
The following should give you what you want.
Open in new window