I'm trying to learn fluent nhibernate better, so I'm building a basic sample application from scratch, instead of using someone else's elses framework. However, I find that I really do not understand what happens when mapping files are assigned. I have seen many code examples that show the same code, but none of this says. There is no description of how it works, it just works. Here is an example of the code that I often see.
return Fluently.Configure()
.Database(config)
.Mappings(m => m.FluentMappings.AddFromAssemblyOf<Entity>())
.BuildSessionFactory();
So, in the sample code, what is Entity? and how does this piece of code work?
Part of me thinks this is the name of the assembly, but seeing how the namespace I use is usually the name of the assembly, the compiler complains that I use the namespace as a type.
I think this is important, and I'm rather confused by what I can’t understand.
thank
source
share