view Agendas/trunk/src/Agendas.Repositories.Tests/Infraestructure/RequestEmulator.cs @ 302:11dddcc9a862 tip

Historico de Eventos, no muestra bien la Url del Patrocinador.
author juanjose.montesdeocaarbos
date Tue, 14 Aug 2012 21:54:30 -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();
		}
	}
}