view Agendas/trunk/src/Agendas.Repositories.Tests/Infraestructure/RequestEmulator.cs @ 234:cc71f96ac134

Combinar
author juanjose.montesdeocaarbos
date Tue, 04 Oct 2011 20:36:27 -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();
		}
	}
}