Skip to content

Instantly share code, notes, and snippets.

View Azerothian's full-sized avatar

Matthew Mckenzie Azerothian

View GitHub Profile
@Azerothian
Azerothian / gist:1375166
Created November 18, 2011 00:58 — forked from bdallen/gist:1375162
Blah
List<normutils.data.Entities.DHCPLease> _leases;
using (ISession session = Global._DatabaseConn.OpenSession())
{
using (ITransaction transaction = session.BeginTransaction())
{
// Get list of all Leases
//Leases = session.CreateCriteria(typeof(normutils.data.Entities.DHCPLease)).List<normutils.data.Entities.DHCPLease>();
var LQ = session.Query<normutils.data.Entities.DHCPLease>();
_leases = (from v in LQ
where v.BindState == "active"
// -------------------------------------
// - Branches Table Mapping - Branches.cs
// -------------------------------------
// Initial Table Mapping - 01.02.2011 - B Allen
using System;
using System.Collections.Generic;
using System.Data.Linq;
using System.Text;
using normist.data.Abstraction;
using NHibernate.Mapping.Attributes;
using System;
using NHibernate.Tool.hbm2ddl;
using NHibernate.Mapping.Attributes;
using NHibernate.Cfg;
using NHibernate;
using log4net;
using System.Reflection;
using System.Web;
using System.CodeDom.Compiler;
using Microsoft.CSharp;
/// <summary>
/// Make the new nHibernate Manager Object
/// </summary>
public Manager()
{
// Setup Logging
log4net.Appender.FileAppender appender = new log4net.Appender.FileAppender();
appender.File = @".\logs\data-manager.log";
appender.LockingModel = new log4net.Appender.FileAppender.MinimalLock();
appender.ImmediateFlush = true;