免费的 NHibernate 辅助工具? [英] Free NHibernate helper tools?

查看:22
本文介绍了免费的 NHibernate 辅助工具?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否有任何免费工具可以帮助简化 .NET 3.5 中 NHibernate 项目的工作?主要是,我正在寻找某种代码和配置文件生成器来自动化一些使用 NHibernate 的较乏味的部分.

Are there any free tools to help simplify working with an NHibernate project in .NET 3.5? Primarily, I'm looking for some kind of code and config file generator to automate some of the more tedious parts of working with NHibernate.

推荐答案

Fluent-NHibernate 提供了另一种编写映射的方法,例如,它比标准 XML 方法更易于重构.

Fluent-NHibernate presents an alternative way of writing your mapping, that for example is more refactor friendly than the standard XML approach.

示例:

public CustomerMap : ClassMap<Customer>
{
  public CustomerMap()
  {
    Id(x => x.ID);
    Map(x => x.Name);
    Map(x => x.Credit);
    HasMany<Product>(x => x.Products)
      .AsBag();
    Component<Address>(x => x.Address, m =>  
    {  
        m.Map(x => x.AddressLine1);  
        m.Map(x => x.AddressLine2);  
        m.Map(x => x.CityName);  
        m.Map(x => x.CountryName);  
    });
}

这篇关于免费的 NHibernate 辅助工具?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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