What is the "Entity" reffering to in fluent Nhibernate Mapping Configuration?

Posted by percent20 on Stack Overflow See other posts from Stack Overflow or by percent20
Published on 2010-04-22T22:41:38Z Indexed on 2010/04/22 22:43 UTC
Read the original article Hit count: 222

Filed under:
|
|

I am trying to learn fluent nhibernate better so am doing a basic sample application from scratch, instead of using someone elses framework. However, I am finding I really don't understand what is going on in assigning mapping files. I have seen a lot of code examples which are all showing the same code, but nothing that spells it out. No description of how it works just that it works. Here is a code example that I see often.

return Fluently.Configure()
            .Database(config)
            .Mappings(m => m.FluentMappings.AddFromAssemblyOf<Entity>())
            .BuildSessionFactory();

So in the code example what is Entity? and how does that piece of code work?

Part of me thinks it is the name of the assembly, but seeing as how the namespace I am using is usually the name of the assembly the compiler complains that I am using a namespace as a type.

I feel this is important and am rather flustered by the fact I can't figure it out.

Thanks

© Stack Overflow or respective owner

Related posts about fluent-nhibernate

Related posts about .NET