Using NHibernate with an ASP.NET MVC 3 Application
Once a company has created a database and the internal systems to control the data, it is not very difficult to use the data again with other functionality. The myGuitarStore database contains information about the types of guitars, the builder, the model, and the cost. Obviously, this information is something a potential customer would like to know before making a purchase. One of the best means of providing this information to a customer is via a website. Therefore, this chapter describes and creates a website that implements ASP.NET MVC 3 using NHibernate.
To create the website shown in Figure 6-1, you will perform the following activities:
- Install ASP.NET MVC 3, which deposits the MVC 3 assemblies and registers them into the Global Assembly Cache (GAC).
- Add an ASP.NET MVC project to the existing GuitarStore solution.
- Configure NHibernate and the Session solution.
- Configure the View and Controller.
INSTALLING ASP.NET MVC 3
ASP.NET MVC 3 is not installed with Visual Studio 2010. Therefore, you need to download it from the Microsoft website at www.asp.net/mvc/mvc3 and install it just as you would any other software package. The ASP.NET MVC 3 download used in this example is AspNetMVC3ToolsUpdateSetup.exe.
ADDING AN ASP.NET MVC 3 PROJECT TO THE GUITARSTORE SOLUTION
Open Microsoft Visual Web Developer 2010 Express ...