Mercurial > altnet-hispano
diff 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 diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/Agendas/trunk/src/Agendas.Tests/Cruds/RequestEmulator.cs Thu Jul 28 09:26:24 2011 -0300 @@ -0,0 +1,23 @@ +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(); + } + } +} \ No newline at end of file