私人物业映射与流利的nhibernate [英] Private property mapping with fluent nhibernate

查看:132
本文介绍了私人物业映射与流利的nhibernate的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述


我在Entity.cs中有这个:
privat int m_Inactive;

p>和EntityMap.cs中我有:
$ b $ pre $ code Map(x => Reveal.Property< Entity>(m_Inactive ))的ColumnName( INACTIVE)。。

但是我得到这个错误:

  System.Reflection.TargetInvocationException:异常已被
抛出
调用的目标。 ---> System.ArgumentException:不是一个成员访问

原因是什么?



谢谢。

解决方案

如果您按照 wiki上的例子,你会发现你应该使用 Map Reveal.Member< YourEntity>(m_Inactive))


I am getting exception mapping a private property.This is the situation: I have this in Entity.cs: privat int m_Inactive;

and in EntityMap.cs I have :

Map(x => Reveal.Property<Entity>("m_Inactive")).ColumnName.("INACTIVE"); 

But I get this error:

System.Reflection.TargetInvocationException: Exception has been thrown 
by 
the target of an invocation. --->  System.ArgumentException: Not a member access 

What could be the reason?

Thanks.

解决方案

If you follow the examples on the wiki you'll see that you're supposed to use Map(Reveal.Member<YourEntity>("m_Inactive")).

这篇关于私人物业映射与流利的nhibernate的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆