The whole “swappable dal” thing didn’t work out. It could’ve, but it would’ve been too much work, so I dropped it. I can play with SubSonic and the entity framework some other times.
Selecting into a new object
I created a couple view in the database and added them to the dbml. Reading is not a problem, but I’m curious how it handles attempted updates. (It is a view, afterall).
I ran into a new LINQ situation. So far, all queries have been like:
from p in this.TableName
But, I only wanted a few fields from the view. How do you do that? It can’t return a known object because you’re specifying the fields on fly. I determined that I have to create a new object that has properties for just the fields I want, and return a list of those. So, I created a FamilyMember object.
I don’t know if that’s the right way to do it, but it works. I read a LINQ book several months ago. I’ll have to get back to it. I’ll absorb a lot more on the second pass due to the rudimentary hands on.
Extend the View Object
I added a new method to the vwClanFamily class.
Its used on the page in the inner loop.