I have a table, which is mapped with NHibernate:
Person
------
Firstname
Lastname
There is also a DTO which is called Person
.
Now, there are possibilities, that there are more fields, than known at design-time. The user can add customer defined fields at runtime. In this case, there are generated additional fields to my table (this is historically and I cannot change this).
The "new" table is looking now like:
Person
------
Firstname
Lastname
IF_Field1
IF_Field2
Now, I am searching a way to get this values (from IF_Field1, IF_Field2 etc) with NHibernate into the DTO Person
. For example as a Hashtable or something similar.
Is there a way to reach my goal?
Have a look at dynamic components: http://nhibernate.info/doc/nh/en/index.html#components-dynamic