views:

889

answers:

2

Hi

I am trying to get test running that uses FluentNHibernate to map my entities.

I get unknown entity class error.

I have a Domain project that has my entities and the mappings in a seperate folder in that project.

My test project has the Nhibrenate configuration in the App.Config.

Any ideas please???

Malcolm

EDIT: I have this method that creats the ISessionFactory but I dont think this code is working and this is why it does not recoginze me mappings exist at all. The SessionFacoryCreator is the assembly with my AppConfig and Recipe is my assembly where the Domain objects are. Please HELLLLLLP!!!!

public static ISessionFactory Create()
        {
            Configuration cfg = new Configuration()
                .AddAssembly(typeof(SessionFactoryCreator).Assembly)
                .AddAssembly(typeof(Recipe).Assembly);

            return cfg.BuildSessionFactory();
        }
A: 

How do you add your Entities to the Hibernate framework? Are you using AnnotationConfiguration or just Configuration? If you are using annotations you must add your annotated entity to the framwork. Otherwise, if you are using xml hibernate mapping, the syntax could be worng (iirc)

Schildmeijer
Yes just Configuration. I am using mappings for FluentNhibernate. They are in a folder in my Domain project????????
Malcolm
A: 

Have you read the wiki? Your example shows nothing of hooking Fluent NHibernate into the session factory building, that'd be why it isn't working. Start with the Getting Started guide.

James Gregory

related questions