views:

48

answers:

1

I'm attempting to use Fluent NHibernate auto mappings for the first time. It appears that the code I'm using isnt generating any mappings. It has been pretty much copy-pasted from the Auto mapping wiki page.

var mappings = AutoMap
    .AssemblyOf<MvcBugs.Model.Project>();
mappings.WriteMappingsTo("c:\\temp\\mappings");

var sessionFactory = Fluently.Configure()
.Mappings(m => m.AutoMappings.Add(mappings))
.Database(SQLiteConfiguration.Standard.InMemory())
.ExposeConfiguration(c => { new SchemaExport(c)
    .SetOutputFile("c:\\temp\\schema.sql")
    .Create(false, true); })
.BuildSessionFactory();

(also would someone create an auto-mapping tag, I'm too new or something)

+1  A: 

this appears to be a bug. Removing the line:

mappings.WriteMappingsTo("c:\\temp\\mappings");

Makes the mappings get set up correctly.

JeffreyABecker

related questions