使用 FluentNHibernate 自动映射自定义集合
我正在改造一个非常大的应用程序以使用 NHibernate 作为其数据访问策略。 AutoMapping 一切进展顺利。幸运的是,当构建领域层时,我们使用了代码生成器。我现在遇到的主要问题是每个集合都隐藏在派生自 List<> 的自定义类后面。例如,
public class League
{
public OwnerList owners {get;set;}
}
public class OwnerList : AppList<Owner> { }
public class AppList<T> : List<T> { }
我必须编写什么样的约定才能完成此任务?
I am retrofitting a very large application to use NHibernate as it's data access strategy. Everything is going well with AutoMapping. Luckily when the domain layer was built, we used a code generator. The main issue that I am running into now is that every collection is hidden behind a custom class that derives from List<>. For example
public class League
{
public OwnerList owners {get;set;}
}
public class OwnerList : AppList<Owner> { }
public class AppList<T> : List<T> { }
What kind of Convention do I have to write to get this done?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我认为通过会议无法实现这一目标。您必须创建自动映射覆盖,然后执行以下操作:
I don't think you're going to be able to achieve this with a convention. You will have to create an auto mapping override and then do the following: