Book Image

MASTERING NSERVICEBUS AND PERSISTENCE

By : Richard L Helton
Book Image

MASTERING NSERVICEBUS AND PERSISTENCE

By: Richard L Helton

Overview of this book

Table of Contents (15 chapters)
Mastering NServiceBus and Persistence
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

Entering NHibernate


NServiceBus takes care of the mapping interface from the objects to relational databases. We will briefly cover how mapping occurs with NHibernate in a typical non-NSB application if the developer needs to walk through an NHibernate source in NSB or extend it.

Entity Framework is definitely the way to go for SQL Server, but there is a chance that you may have to deal with Oracle or MySQL. There are multiple ways to create the mapping from the objects to relations. One method is to code in the hbm.xml files and another is to use Fluent API. For more on Fluent API, see http://en.wikipedia.org/wiki/Fluent_interface.

We will use the Fluent API in NHibernate, which will utilize mapping in code instead of in XML. You may find more information on Fluent NHibernate at http://www.fluentnhibernate.org/. In order to use Fluent NHibernate, we will need to add it as a reference via NuGet.

For the NHibernate pieces, there will be a session interface instead of an EF context interface...