从流畅的Nhibernate生成XML映射 [英] Generate XML mappings from fluent Nhibernate

查看:138
本文介绍了从流畅的Nhibernate生成XML映射的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何在MappingIntegrationTests中生成xml映射文件

我需要手工检查流利映射是否与leagcy项目中的映射关联。

解决方案

您可以执行以下操作:

  config.Mappings(m => 
{
m.FluentMappings.ExportTo(... file path here ...);
m.HbmMappings.ExportTo (... file path here ...);
m.AutoMappings.ExportTo(... file path here ...);
{
);

我自己不喜欢它。如果我找到一些更好的方法(如果存在的话),我会更新答案。



请参阅
http://blog.jagregory.com/2009/02/03/fluent- nhibernate-configurations-your-application /

或者如果发生故障,请看这个代码

https://github.com/jagregory/fluent-nhibernate/wiki/Database-configuration


How do I generate xml mappings files as part of my tests in MappingIntegrationTests

I need to manually check if the fluent mappings correlate to the mappings in the leagcy project.

解决方案

You can do something like:

 config.Mappings(m => 
    {
        m.FluentMappings.ExportTo("...file path here...");
        m.HbmMappings.ExportTo("...file path here...");
        m.AutoMappings.ExportTo("...file path here...");
    {
);

I don't like it myself. If I find some better way (if such exists at all) I'll update the answer.

See
http://blog.jagregory.com/2009/02/03/fluent-nhibernate-configuring-your-application/
Or if broken, see this instead
https://github.com/jagregory/fluent-nhibernate/wiki/Database-configuration

这篇关于从流畅的Nhibernate生成XML映射的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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