Help! My fingers are falling off from typing so much.
I have a lot of objects that have sane names to them. The Database names are not so sane, and i'm stuck defining my property names in all my projections.
For example:
from f in foo select new MyClass() {MyID = f.ID, MyName = f.f, MyTime = f.t}
Etc.. now, multiply this by hundreds or even thousands of business object methods that materialize data into various classes with mismatched field names and and dozens of properties in most fields andit's a lot of typing.
So, i'm wondering if there is any way (maybe via Attributes or something else) that allows you to define a default mapping for the class so that even if the fields mismatch I can simply say:
from f in foo select new MyClass()
Any solutions? Or am I stuck typing my fingers off?
EDIT:
Upon further reflection (pun semi-intended), I realize that this is precisely what L2S is for, and I can rename the fields in the L2S Data classes to whatever I need.
Sometimes the easiest answers are right in front of us.