view Agendas/trunk/src/Agendas.Repositories.Tests/Infraestructure/RequestEmulator.cs @ 294:0e616662a94b

Added tag v1.1.0 for changeset 2cf7143586fe
author nelopauselli
date Fri, 17 Feb 2012 14:28:05 -0300
parents 68b09c30b0d2
children
line wrap: on
line source

using System;
using NHibernate;
using NHibernate.Context;

namespace Agendas.Repositories.Tests.Infraestructure
{
	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();
		}
	}
}