Skip to content

Instantly share code, notes, and snippets.

@TheHunter
TheHunter / DaoFactoryExample.cs
Last active August 29, 2015 14:00
This is an example about making DAOs using the ISessionFactory instance, using contextual session providers.
namespace YourNamespace
{
public class DaoFactoryTest
{
[Test]
public void TestBuildingDao1()
{
INhPagedDAO dao = NhDaoFactory.MakePagedDAO(this.SessionFactory);
using (dao)
{
@TheHunter
TheHunter / AppStart.cs
Last active December 19, 2016 17:53
A generic class for loading assemblies dynamically a runtime using a Resolver delegate.
public class AppStart
{
private static HashSet<Assembly> Dependencies;
// In this method the assemblies will be loaded into internal collection.
public static void AppInitialize()
{
Dependencies = new HashSet<Assembly>();
LoadDependencyAssemblies();