view Agendas/trunk/src/Agendas.Tests/Cruds/RequestEmulator.cs @ 137:2d1adbaf0373

CRUD de Patrocinador
author nelopauselli
date Thu, 28 Jul 2011 09:26:24 -0300
parents
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();
		}
	}
}