Skip to content

Instantly share code, notes, and snippets.

using Iesi.Collections.Generic;
namespace Concepts.Core
{
public class Person : Entity
{
public virtual string GivenName { get; set; }
public virtual string SurName { get; set; }
public virtual string SurNamePrefix { get; set; }
public virtual string OfficialName { get; set; }
//
// GET: /Person/
public ActionResult Index()
{
var session = FeestBeest.Web.MvcApplication.SessionFactory.GetCurrentSession();
using (session.BeginTransaction())
{
var persons = session.CreateCriteria(typeof(Person))
.List<Person>();
foreach (var p in persons)
@Itslet
Itslet / Global.asax.cs
Created October 31, 2010 08:47
Fluent Nhibernate session per request
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using System.Web.Routing;
using FluentNHibernate.Cfg;
using FluentNHibernate.Cfg.Db;
using NHibernate;
using NHibernate.Context;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace Concepts.ConsoleApp
{
class Program
{
/*