I recently started playing with the ASP.NET MVC NerdDinner sample, and as part of this you can play with Linq to SQL classes. It looks cool, so I decided to come off (maybe prematurely!) And try to create my own MVC application, but this time modeling my own simple database with Linq to SQL.
The problem I am facing is this. Consider the following tables:
The CarPassengers table is a mapping table between Car and Person (it has two columns: CarId, PersonId).
In Linq to SQL, I get a class for each table. But what I really want is a class for Car that has the CarPassengers property, and each child is a Person, not an actual FK (this is normal for selecting results, but for updating Car with new Person objects I must first build them - I can't just add EntitySet CarPassengers without instantiating Person Person objects, I think).
I look around and I saw that the ADO.NET Entity Framework will allow me to achieve this using Entity Splitting, but I wondered if there is an easy way to accomplish the same thing in Linq for SQL and if not, what are the implications Integrating .NET EF with my MVC application.
Any advice, comments, advice would be highly appreciated.
Thanks!