Installing NHibernate

Before we begin, let's get our Visual Studio solution and database set up. The following information will get you up and started with NHibernate.

Getting ready

  1. Install Microsoft SQL Server 2012 Express (or a newer version) on your PC, using the default settings.
  2. Create a blank database named NHCookbook.

How to do it...

  1. In Visual Studio, create a new C# class library project named Eg.Core with a directory for the solution named Cookbook.
  2. Delete the Class1.cs file.
  3. In the Solution Explorer, right click the References node in the Eg.Core project and select Manage NuGet Packages. In the top navigation of the now-opened NuGet Package Manager, make sure Browse is selected. Enter the word NHibernate in the search box and wait for the results ...

Get NHibernate 4.x Cookbook - Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.