JeffreyABecker
JeffreyABecker

Reputation: 2743

FluentNHibernate Automapping not generating mappings

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)

Upvotes: 1

Views: 181

Answers (1)

JeffreyABecker
JeffreyABecker

Reputation: 2743

this appears to be a bug. Removing the line:

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

Makes the mappings get set up correctly.

Upvotes: 1

Related Questions