Fluent NHibernate: Mixing Automapping and manual mapping

廉价感情. 提交于 2019-12-05 04:15:56

It is possible and easy to mix-up mapping configurations:

var cfg = Fluently.Configure()
    .Database(configurer)
    .Mappings(map =>
                  {
                      // Automapping
                      map.AutoMappings.Add(AutoMap.Assemblies(Assembly.GetExecutingAssembly())
                                             .Where(type => type == typeof(Domain.Market.Share))
                                             .Where(type => type == typeof(Domain.HR.Employee)));

                      // Fluent mappings
                      map.FluentMappings.AddFromAssemblyOf<Domain.Client.Macys>();
                  });

Good luck. ;-)

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!