tags:

views:

35

answers:

1

I have been doing quite a bit of work lately that involves taking stored procedure calls and mapping them to private DTO classes. I was thinking the other day there has to be an easier way. So far this is what i have come up with:

  1. CodeSmith - OK solution but it will be a no go where i work. The budget is pretty tight right now.
  2. Typed Dataset - Add columns to the dataset at runtime. While convenient i still don't like it. I've never been a fan of the overhead for a dataset.
  3. IronRuby / IronPython - Maybe read the return from the stored procedure at runtime and dynamically build an object in IronRuby or Python & return the object to VB.Net. I haven't investigated dynamic languages enough in .net to know how good of a solution this would be. I think c# has a little bit better of support with the dynamic keyword but know its not perfect. Where i work we have to use VB.Net and maybe that would make matters worse
  4. Dynamically build objects at runtime with Reflection.Emit--seems really really messy.

Is there a better solution that I'm not aware of? Maybe some open source project? I looked into Automapper but i believe that is just for mapping DTO<-->BusinessObjects. Not really what I'm needing to do.Hopefully in the future we will be able to switch back and forth between dynamic / static languages fairly easily that will make problems like this simple

+1  A: 

Did you consider using the Entity Framework?

http://msdn.microsoft.com/en-us/library/bb896279.aspx

Hightechrider
Unfortunately, we can't use that. We use this homegrown connection type object for security purposes so that stops us from using EF.