annotate 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
rev   line source
137
2d1adbaf0373 CRUD de Patrocinador
nelopauselli
parents:
diff changeset
1 using System;
2d1adbaf0373 CRUD de Patrocinador
nelopauselli
parents:
diff changeset
2 using NHibernate;
2d1adbaf0373 CRUD de Patrocinador
nelopauselli
parents:
diff changeset
3 using NHibernate.Context;
2d1adbaf0373 CRUD de Patrocinador
nelopauselli
parents:
diff changeset
4
2d1adbaf0373 CRUD de Patrocinador
nelopauselli
parents:
diff changeset
5 namespace AltNetHispano.Agendas.Tests.Cruds
2d1adbaf0373 CRUD de Patrocinador
nelopauselli
parents:
diff changeset
6 {
2d1adbaf0373 CRUD de Patrocinador
nelopauselli
parents:
diff changeset
7 public class RequestEmulator : IDisposable
2d1adbaf0373 CRUD de Patrocinador
nelopauselli
parents:
diff changeset
8 {
2d1adbaf0373 CRUD de Patrocinador
nelopauselli
parents:
diff changeset
9 private readonly ISession _session;
2d1adbaf0373 CRUD de Patrocinador
nelopauselli
parents:
diff changeset
10
2d1adbaf0373 CRUD de Patrocinador
nelopauselli
parents:
diff changeset
11 public RequestEmulator(ISessionFactory sessionFactory)
2d1adbaf0373 CRUD de Patrocinador
nelopauselli
parents:
diff changeset
12 {
2d1adbaf0373 CRUD de Patrocinador
nelopauselli
parents:
diff changeset
13 _session = sessionFactory.OpenSession();
2d1adbaf0373 CRUD de Patrocinador
nelopauselli
parents:
diff changeset
14 CurrentSessionContext.Bind(_session);
2d1adbaf0373 CRUD de Patrocinador
nelopauselli
parents:
diff changeset
15 }
2d1adbaf0373 CRUD de Patrocinador
nelopauselli
parents:
diff changeset
16
2d1adbaf0373 CRUD de Patrocinador
nelopauselli
parents:
diff changeset
17 public void Dispose()
2d1adbaf0373 CRUD de Patrocinador
nelopauselli
parents:
diff changeset
18 {
2d1adbaf0373 CRUD de Patrocinador
nelopauselli
parents:
diff changeset
19 _session.Flush();
2d1adbaf0373 CRUD de Patrocinador
nelopauselli
parents:
diff changeset
20 _session.Close();
2d1adbaf0373 CRUD de Patrocinador
nelopauselli
parents:
diff changeset
21 }
2d1adbaf0373 CRUD de Patrocinador
nelopauselli
parents:
diff changeset
22 }
2d1adbaf0373 CRUD de Patrocinador
nelopauselli
parents:
diff changeset
23 }