views:

46

answers:

1

I've searched a lot and I haven't really found an answer.

Is it possible to use POCOs with Subsonic? How do I map tables (which do not look like the POCOs) to my classes?

+1  A: 

SubSonic doesn't provide a built in way to map tables to your POCOs.

The closest it would come would be using the ActiveRecord portion of SubSonic which would generate one class per table (with properties for each table column and foreign key relationship to other tables).

Depending on how your POCOs look, you might be able to get data easily (or not) between the generated ActiveRecord classes and your POCOs. Also, the generated ActiveRecord classes are created via templates which you can modify to fit your needs.

sparks
My tables doesnt look like my pocos, ActiveRecord is therefore not an option. But you answered my question. Guess I gotto stick with nhibernate..
jgauffin

related questions