简体   繁体   English

使用城堡ActiveRecord,当两个类具有相同的名称但名称空间不同时,我得到了NHibernate DuplicateMappingException

[英]Using Castle ActiveRecord, I get an NHibernate DuplicateMappingException when two classes have the same name but different namespaces

The same problem as NHibernate DuplicateMappingException when two classes have the same name but different namespaces . 当两个类具有相同的名称但名称空间不同时,与NHibernate DuplicateMappingException相同的问题。 However, I'm using Castle ActiveRecord so I don't see how I can apply the same solution, using auto-import=false. 但是,我正在使用Castle ActiveRecord,所以我看不到如何使用auto-import = false来应用相同的解决方案。 I dug through the AR code with Reflector but I don't see how I can control the mapping attributes that get generated. 我用Reflector浏览了AR代码,但看不到如何控制生成的映射属性。

Anyone have a way around this? 有人有办法解决吗?

Thanks, tim 蒂姆,谢谢

There is boolean flag UseAutoImport passed to constructor of ActiveRecordAttribute. 布尔标志UseAutoImport传递给ActiveRecordAttribute的构造函数。 See link http://www.castleproject.org/activerecord/documentation/trunk/manual/attributedocs/Generated_ActiveRecordAttribute.html 请参阅链接http://www.castleproject.org/activerecord/documentation/trunk/manual/attributedocs/Generated_ActiveRecordAttribute.html

Vij 维吉

暂无
暂无

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

相关问题 NHibernate DuplicateMappingException 当两个类具有相同的名称但不同的命名空间时 - NHibernate DuplicateMappingException when two classes have the same name but different namespaces 如何处理具有相同名称的两个类的MVC DisplayTemplates(不同的命名空间) - How to handle MVC DisplayTemplates for two classes with the same name (different namespaces) 如何切换具有相同名称和不同名称空间的类? - How to switch classes with same name and different namespaces? C#当从不同的命名空间中使用两组“相同”类时,如何避免两次写入相同的方法? - C# When consuming two sets of “identical” classes from different namespaces, how do I avoid writing the same method(s) twice? 为什么在映射具有相同名称但不同名称空间的类的对象图时,XmlSerializer无法初始化? - Why is XmlSerializer failing to initialize when mapping the object graph of classes with the same name, but different namespaces? 在将Castle Proxies与NHibernate结合使用时,这不会返回相同的参考 - This isn't returning the same reference when using Castle Proxies with NHibernate 两个类同名时如何设置默认类 - How to set the default class when two classes have the same name 在NHibernate中为两个不同的存储库使用相同的模型 - Using the same model for two different repository in NHibernate 实体框架代码优先 - 两个具有相同名称但位于不同名称空间的实体 - Entity Framework Code First - two entities with same name but in different namespaces 当不同表中的两列具有相同名称时,如何使用SqlDataReader读取数据? - How to read data using SqlDataReader when two columns in different tables have same name?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM