fluent-nhibernate icon indicating copy to clipboard operation
fluent-nhibernate copied to clipboard

Problem with conventions when combining AutoMap and Fluent mappings

Open ajoka opened this issue 12 years ago • 0 comments

Ive tried to combine auto-mapping with fluent mapping and hbm.xml

Ive added the same conventions for the autoMAp as for the fluent. Everyting was ok. If I removed the conventions from the AutoMap part, the conventions were not applied for the Fluent either.

_configuration = Fluently.Configure()
    .Database(persistenceConfigurer)
    .Mappings(m =>
    {
        m.AutoMappings.Add(
            AutoMap.AssemblyOf<Entita>(new AutoMappingConfiguration())
    .Conventions.AddFromAssemblyOf<AutoMappingConfiguration>()
    // If you ommit conventions here, .FluentMappings.Conventions won't work either!
);
                        m.FluentMappings.Conventions.AddFromAssemblyOf<IMappingNamespaceMarker>();              m.FluentMappings.AddFromAssemblyOf<IMappingNamespaceMarker>();
                    m.HbmMappings.AddFromAssemblyOf<IMappingNamespaceMarker>();
                    })

ajoka avatar Feb 18 '13 22:02 ajoka