Summary

We have come to the end of an exhaustive chapter. NHibernate mapping is a vast topic. Especially if you are new to NHibernate or any ORM, you would find it challenging to remember and use all mappings effectively. What I have tried in this chapter is to present you with absolute minimum of NHibernate mappings that you need to know in order to hit the ground running. I hope that this chapter took the hardest part of the challenge away for you. You should now have a fair idea of how to map a simple domain model to an appropriate database schema. You may not feel very confident about NHibernate just yet and that is all but natural. This chapter and the next one are meant to introduce you to theoretical building blocks that are necessary before we get into interesting parts of NHibernate. In the next chapter, we would look at how to configure NHibernate which is another essential building block of NHibernate. As with mapping, NHibernate configuration is versatile and comes with lot of defaults that make our lives easier but knowing all the knobs makes you ready for those moments when you are just not able to get to the root of that annoying bug in your data access layer. Once you master the mappings and configuration, you are ready to conquer the world of data access using NHibernate.

Note

When you download source code of this chapter, then you will find that the code for unit tests is not exactly the same as the one presented here. That is mainly because I had to refactor the unit tests as we progressed through the chapter in order to accommodate for the new concepts we were learning. I also used some advanced NUnit features so that some unit tests could be run multiple times for different mapping methods.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.118.141.27