Fluent NHibernate: Autopilot Movement and Manual Matching

If you are using Fluent NHibernate, is it possible to automate most classes, but specify that several specific classes should be displayed using the regular API, not an automaton? And if so, can someone point me to an example code that shows how to do this?

Thanks!

+7
nhibernate fluent automapping
source share
1 answer

It is possible and easy to mix 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 .; -)

+11
source share

All Articles