How to include associative table information and still retain strong typing
- by mwright
I am using LINQ to SQL to create strongly typed objects in my project.
Let's say I have an object that is represented by a database table. This object has a "Current State" that is kept in an associative table.
I would like to make a single db call where I pull back the two tables joined but am unsure how I should be populating that information into some sort of object to preserve strong typing within my model so that the view using the information can just consume the information from the objects. I looked into creating a view model for this but it doesn't seem to quite fit.
Am I thinking about this in the wrong way? What information can I include to help clarify my problem?
Other details that may or may not be important: It's an MVC project....