Hi,
It's me again :) I had a strange thing happening just now. I can not add
fluent mappings but automappings work.
FLUENT MAPPING
_sessionFactory = Fluently.Configure()
.Database(SQLiteConfiguration.Standard.UsingFile(PathToSqlLiteDb))
.Mappings(m =>
m.FluentMappings.AddFromAssemblyOf<NewsMap>())
.ExposeConfiguration(BuildSchema)
.BuildConfiguration().BuildSessionFactory();
_session = _sessionFactory.OpenSession();
AUTO MAPPING
_sessionFactory = Fluently.Configure()
.Database(SQLiteConfiguration.Standard.UsingFile(PathToSqlLiteDb))
.Mappings(m =>
m.AutoMappings.Add(AutoPersistenceModel.MapEntitiesFromAssemblyOf<Club>()))
.ExposeConfiguration(BuildSchema)
.BuildConfiguration().BuildSessionFactory();
_session = _sessionFactory.OpenSession();
BuildSchema
private void BuildSchema(Configuration config)
{
if (File.Exists(PathToSqlLiteDb))
{
File.Delete(PathToSqlLiteDb);
}
new SchemaExport(config).Create(true, true);
}
The mappings are located in a different assembly than the entities. Is there
something I need to explicitly do to make it work then?
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Fluent NHibernate" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/fluent-nhibernate?hl=en
-~----------~----~----~----~------~----~------~--~---