view Agendas/trunk/src/Agendas.Tests/Cruds/RequestEmulator.cs @ 142:62dc9fb3a03e

Quitando cuentas BuiltIn
author Nelo@Guinea.neluz.int
date Mon, 01 Aug 2011 00:28:04 -0300
parents 2d1adbaf0373
children
line wrap: on
line source

using System;
using NHibernate;
using NHibernate.Context;

namespace AltNetHispano.Agendas.Tests.Cruds
{
	public class RequestEmulator : IDisposable
	{
		private readonly ISession _session;

		public RequestEmulator(ISessionFactory sessionFactory)
		{
			_session = sessionFactory.OpenSession();
			CurrentSessionContext.Bind(_session);
		}

		public void Dispose()
		{
			_session.Flush();
			_session.Close();
		}
	}
}