I am a somewhat experienced Rails developer and I thought I would try out ASP.NET's version of MVC. In doing so I also decided to try Linq->Sql...
I am a bit confused about the way Linq->Sql handles joins.
A trivial example of my schema is :
books:
id
title
categories:
id
name
books_categories:
book_id
category_id
Simply dragging these tables to the .dbml file doesn't seem to do it. I get a property on my Book class books_categories, what I expect is a property that I can iterate over and get Category classes directly.
Right now I have to do something that feels very wrong
foreach (books_categories bc in book.books_categories)
{
category_names.Add(bc.Category.category.Trim());
}
[In Response to Accepted answer]
I grudgingly accepted the answer of "write your own glue code". After continuing my research of Linq->Sql I discovered that it is apparently slowly being let go in favor of the (more powereful, IMO) Entity Framework. EF still allows one to use LINQ for queries and does a decent job of figuring out relationships like Ruby's ActiveRecord.