In my previous post I have talk about Nhibernate and NHibernate Mapping. As i have already realized the power of Nhibernate , and I have dug it down more and more . Will everything works like charm but I personally found to create mapping file for all the entities/object. So I have decided to look for some more relevent solution so that I really can avoid this mapping step while working on my appplicaiton.
Fluent Nhibernet is the answer of my problem .Fluent nhibernate is an auto mapper which create mapping of your objects with the database table columns. We really do not have to worry about the mapping now and we can concentrate more on writing better application. You can download Fluent Nhibernate from here . I am also attaching sample business model to use Fluent Nhibernate . You can download code form here .
You need to reference some libraries as below .
I have wrapped the use of Nhibernate in Repository . It really adds more power and flexibility to the application when Nhibernate is used with Repository pattern.
Note that i have used the namespace “FluentNhibernateSampleORM.Model” Now Fluent Nhibernate will pick up all the objects under this namespace automatically and map it to the database .