【发布时间】:2017-09-26 20:52:29
【问题描述】:
我有两个单独的表。
[users] [ roles ]
+-----+ +-------+
| id | |user_id|
+-----+ +-------+
| value | <- [Represented by the enum]
+-------+
还有他们的模型。
class User { int id; IList<Roles> Roles; }
enum Roles { Worker, Manager, Director }
如您所见,它很简单“一对多”。用户有很多角色。如何在 XML 中映射这些模型?
【问题讨论】:
-
位掩码操作可能会解决这个问题。但在这种情况下,我需要更改现有的 API。
标签: c# .net nhibernate nhibernate-mapping