The construction of NHibernate

Source: Internet
Author: User

1. New Project

Business: Logic Classes

Data: Database operation and NHibernate helper classes

Domain: Data entities and database mapping files

2. Download NHibernate using NuGet

Database configuration file under Folder Packages\nhibernate.4.1.1.4000\configurationtemplates

The SQL Server database is used here, so copy MSSQL.cfg.xml to the NHibernate project, modify the file name: Hibernate.cfg.xml, and modify the connection configuration for the database. <mapping assembly= "Domain" > Specify entity class mapping file.

Note Modify the properties of the XML to always copy or to update the replication more.

The new entities and Mappings folders in domain hold entity classes and mapping files, respectively. Entity classes use automatic attributes and are virtual, noting that the mapping file for an entity class is to be set to an embedded resource.

New Nhibernatehelper Helper Class

To add a data access layer:

To add a business logic layer:

Project Overall Document:

Call

: http://pan.baidu.com/s/1nuCRhC9

The construction of NHibernate

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.