Hi all
I am getting the following runtime error in my ASP.Net MVC application:
NHibernate.MappingException: No persister for: MyProject.Model.MyDomainObject
I am referencing the burrow and fluent binaries in my application and am reconfiguring burrow in Global.asax on Application_Start as follows:
var bf = new BurrowFramework();
IFrameworkEnvironment fe = bf.BurrowEnvironment;
Configuration cfg = fe.GetNHConfig("PersistenceUnit1");
cfg.AddMappingsFromAssembly(Assembly.LoadFrom(Server.MapPath("~/bin/MyProject.Data.dll")));
fe.RebuildSessionFactories();
I cannot for the life of me figure this out. If I setup a fluent NHibernate AutoPersistenceModel with my domain objects then everything works fine, it just doesn't work for manually configured fluent maps.
The single map I have is as follows:
public class MyDomainObjectMap : ClassMap<MyDomainObject>
{
public MyDomainObjectMap()
{
WithTable("my_domain_object");
Id(x => x.Id);
Map(x => x.Name);
Map(x => x.Description);
}
}
Any help would be much appreciated, please let me know if you need more detail.
Thanks