Hi,
I am writing an app using FluentNHibernate.
To start with I am trying to run a test where I insert a row into my db table.
My entities are in a seperate project (OurRecipes.Domain) and my mappings ie ClassMap<entity> classes are in a folder in this project.
In my test project I have the configuration of NHibernate in the App.Config.
So when I run the test the error occurs on this line session.Load below.
Error is
No persister for: OurRecipes.Domain.Recipe
Code:
using (var session = factory.OpenSession())
{
Recipe recipe = session.Load<Recipe>(1);
}
This is how how I am creating my ISessionFactory
Code:
namespace OurRecipes
{
public class SessionFactoryCreator
{
public static ISessionFactory Create()
{
Configuration cfg = new Configuration()
.AddAssembly(typeof(SessionFactoryCreator).Assembly)
.AddAssembly(typeof(Recipe).Assembly);
return cfg.BuildSessionFactory();
}
}
}
It seems to me that this code is doing nothing and not loading the mappings at all. Recipe is in my entity project with the mappings and SessionFactoryCreator is in my tes project with App.Config.
Any ideas why I get this error please?
Malcolm