Free NHibernate helper tools?

后端 未结 10 2127
庸人自扰
庸人自扰 2020-12-23 23:19

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 automat

10条回答
  •  半阙折子戏
    2020-12-24 00:06

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

    Example:

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

提交回复
热议问题