I've recently refactored my application with the following: Linq to SQL db connection Objects to wrap the linq to sql classes Mappers to map back and forth between objects and Linq to Sql entitys Service layer to call the repository, handing up objects to the UI.
Before I was just using Linq to SQL objects in my UI (I know). But when displaying relations it was so easy. For instance:
I have a able called SchoolProfile, and a table called School. A user has a SchoolProfile (with GPA, Rank, etc..) , which links to a School. The School adding functionality was easy - because it has no foreign keys.
When creating a form for a user to list all SchoolProfiles - they dont want to see a SchoolId. Before in my view it would simply be schoolprofile.School.Name. Now a ShoolProfile is a "flat" object in my ViewData with no properties. I guess I could create other classes to get the related data (name of the school, etc..) but that feels messy. Any suggestions?