简体   繁体   English

使用NHibernate读取未知的其他字段

[英]Read unknown additional fields with NHibernate

I have a table, which is mapped with NHibernate: 我有一个表,它与NHibernate映射:

 Person
 ------
 Firstname
 Lastname

There is also a DTO which is called Person . 还有一个DTO,称为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 . 现在,我正在寻找一种方法,用NHibernate将此值(从IF_Field1,IF_Field2等)获取到DTO Person For example as a Hashtable or something similar. 例如作为Hashtable或类似的东西。

Is there a way to reach my goal? 有没有办法实现我的目标?

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM