views:

38

answers:

1

I have a situation wherein to accomodate the need of dynamic addition of columns to a table, I am putting the columns values as rows in a table.
As an example, storing of columns of an Address Table would be in the format:

ID    PropertyName
1     HouseNo.
2     Street
3     City
4     State
5     Country

Now, if I need to create an ORM for such kind of table design in code, does LINQ2SQL, NHibernate or Entity framework provide a way for handling this?
Or what would be the most suitable way to deal with this kind of model? Manually creating business classes?

Thanks!

+2  A: 

NHibernate can achieve something similar using the <dynamic-component> mapping, have a look at this article for more details.

Update:

Although somewhat similar to what you were asking about, the <dynamic-component> doesn't really achieve your goals; what you should actually be looking at is the <map> mapping, that's described here.

DanP