NPersistence tutorial - web site

You are here

Creating an ASP.NET web site is different than creating an ASP.NET web application. In a web site, the user has less control over the dll assembly that is created as part of the project and the technique of marking an XML file as an ‘embedded resource’ is not available and can’t be used for creating the persistence.xml file required for NHibernate-NPA.

In the following guide we will create a small web site project – "Hello NHiberante NPA web site" which manages one persistence class in a web site.

"Hello NHibernate-NPA web site"In this sample web site we will set up one persistent class and one configuration file which configures both the web site and NPersistence. We use the MySql database in which we create the table to which the persistent class will be mapped to.

Prerequisites:

• Download and install MySql database. The sample application uses the mySql.dll and other configuration parameters. You may use any other DB as long as you set the required dll and parameters.