Click here to Skip to main content
Click here to Skip to main content
Add your own
alternative version

Simple NHibernate Architecture

, 11 Sep 2012 CPOL
An article showing a nice architecture I've come up for using NHibernate
nhibernatesample.zip
NHibernateSample
Business
bin
Debug
Business.dll
Business.pdb
Castle.DynamicProxy.dll
Iesi.Collections.dll
log4net.dll
NHibernate.dll
Shared.NHibernateDAL.dll
Shared.NHibernateDAL.pdb
NHibernateDAL.cd
obj
Debug
Business.dll
Business.pdb
ResolveAssemblyReference.cache
TempPE
Properties
NHibernateDAL
bin
Debug
Castle.DynamicProxy.dll
Iesi.Collections.dll
log4net.dll
NHibernate.dll
NHibernateDAL.dll
NHibernateDAL.pdb
Shared.NHibernateDAL.dll
Shared.NHibernateDAL.pdb
mssccprj.scc
NHibernateDAL.csproj.vspscc
obj
Debug
NHibernateDAL.dll
NHibernateDAL.pdb
Refactor
NHibernateDAL.dll
Shared.NHibernateDAL.dll
ResolveAssemblyReference.cache
Shared.NHibernateDAL.dll
Shared.NHibernateDAL.pdb
TempPE
Properties
vssver2.scc
Shared.NHibernateDAL.csproj.vspscc
vssver2.scc
Web
App_Data
Bin
Business.dll
Business.pdb
Castle.DynamicProxy.dll
Iesi.Collections.dll
log4net.dll
NHibernate.dll
Shared.NHibernateDAL.dll
Shared.NHibernateDAL.pdb
<?xml version="1.0"?>
<!-- 
    Note: As an alternative to hand editing this file you can use the 
    web admin tool to configure settings for your application. Use
    the Website->Asp.Net Configuration option in Visual Studio.
    A full list of settings and comments can be found in 
    machine.config.comments usually located in 
    \Windows\Microsoft.Net\Framework\v2.x\Config 
-->
<configuration>
  <configSections>
    <section name="nhibernate" type="System.Configuration.NameValueSectionHandler, System, Version=1.0.5000.0,Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false"/>
  </configSections>
  <appSettings>
    <add key="HBM_ASSEMBLY" value="Business" />
	</appSettings>

  <nhibernate>
    <add key="hibernate.dialect" value="NHibernate.Dialect.MsSql2000Dialect"/>
    <add key="hibernate.connection.provider" value="NHibernate.Connection.DriverConnectionProvider"/>
    <add key="hibernate.connection.connection_string" value="Server=127.0.0.1\SQL2005;Database=NHibernate;Trusted_Connection=yes;"/>
    <add key="hibernate.bytecode.provider" value="null"/>
    <!-- Important under Medium Trust -->
    <add key="hibernate.current_session_context_class" value="managed_web"/>
  </nhibernate>
  
	<connectionStrings/>  
	<system.web>
		<!-- 
            Set compilation debug="true" to insert debugging 
            symbols into the compiled page. Because this 
            affects performance, set this value to true only 
            during development.
        -->
		<compilation debug="true"/>
		<!--
            The <authentication> section enables configuration 
            of the security authentication mode used by 
            ASP.NET to identify an incoming user. 
        -->
		<authentication mode="Windows"/>
		<!--
            The <customErrors> section enables configuration 
            of what to do if/when an unhandled error occurs 
            during the execution of a request. Specifically, 
            it enables developers to configure html error pages 
            to be displayed in place of a error stack trace.

        <customErrors mode="RemoteOnly" defaultRedirect="GenericErrorPage.htm">
            <error statusCode="403" redirect="NoAccess.htm" />
            <error statusCode="404" redirect="FileNotFound.htm" />
        </customErrors>
        -->
	</system.web>
</configuration>

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

Share

About the Author

Cassio Mosqueira
Software Developer (Senior) Intelligent Coder
Canada Canada
I've been developing .NET enterprise applications since 2000.
 
I am originally from Rio de Janeiro and I am currently working at http://www.intelligentcoder.com in Ontario.

| Advertise | Privacy | Mobile
Web03 | 2.8.141022.1 | Last Updated 11 Sep 2012
Article Copyright 2007 by Cassio Mosqueira
Everything else Copyright © CodeProject, 1999-2014
Terms of Service
Layout: fixed | fluid