Save entities to the database
Clearly we have saved entities to the database in many of the previous recipes, but it's time to dig a bit deeper into how that actually works. This recipe will explore different ways of saving and what happens behind the scenes.
- Create a new Windows forms project named
SessionRecipes, in Visual Studio.
- Add a reference to
NHibernateusing NuGet Packet Manager Console:
Install-Package NHibernate -project SessionRecipes
- Also add a reference to
Install-Package NH4CookbookHelpers -project SessionRecipes
- Remove the class
Form1.csfrom the project.
using NH4CookbookHelpers;to the top of
Program.csso that the last line in
Application.Run(new WindowsFormsRunner()); ...