Hi. I have the following (pretty standard) table structure:
Post <-> PostTag <-> Tag
Suppose I have the following records:
PostID Title
1, 'Foo'
2, 'Bar'
3, 'Baz'
TagID Name
1, 'Foo'
2, 'Bar'
PostID TagID
1 1
1 2
2 2
In other words, the first post has two tags, the second has one and the third one doesn't have any.
I'd like to load all posts and it's tags in one query but haven't been able to find the right combination of operators. I've been able to load either posts with tags only or repeated posts when more than one tag.
Given the database above, I'd like to receive three posts and their tags (if any) in a collection property of the Post objects. Is it possible at all?
Thanks