view Agendas/trunk/src/Agendas.Tests/Cruds/RequestEmulator.cs @ 165:56f62516c172

Merge
author nelopauselli
date Fri, 05 Aug 2011 22:05:19 -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();
		}
	}
}