view Agendas/trunk/src/Agendas.Tests/Cruds/RequestEmulator.cs @ 138:62791999ad01

Agregando relación entre Evento y Patrocinador
author nelopauselli
date Thu, 28 Jul 2011 10:13:28 -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();
		}
	}
}