使用流利的nhibernate进行私有属性映射

6 fluent fluent-nhibernate

我正在获取异常映射私有属性.这是情况:我在Entity.cs中有这个:privat int m_Inactive;

在EntityMap.cs我有:

Map(x => Reveal.Property<Entity>("m_Inactive")).ColumnName.("INACTIVE"); 
Run Code Online (Sandbox Code Playgroud)

但我得到这个错误:

System.Reflection.TargetInvocationException: Exception has been thrown 
by 
the target of an invocation. --->  System.ArgumentException: Not a member access 
Run Code Online (Sandbox Code Playgroud)

可能是什么原因?

谢谢.

Jam*_*ory 14

如果你按照维基上例子,你会看到你应该使用Map(Reveal.Member<YourEntity>("m_Inactive")).