0

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?

BennoDual
  • 5,865
  • 15
  • 67
  • 153

1 Answers1

0

Have a look at dynamic components: http://nhibernate.info/doc/nh/en/index.html#components-dynamic

hazzik
  • 13,019
  • 9
  • 47
  • 86
Oskar Berggren
  • 5,583
  • 1
  • 19
  • 36
  • See also http://ayende.com/blog/3942/nhibernate-mapping-dynamic-component. But it won't work because the property names need to be known and mapped. – Jamie Ide Nov 12 '12 at 13:59