Mercurial > altnet-hispano
annotate Agendas/trunk/src/Agendas.Repositories.Tests/Infraestructure/RequestEmulator.cs @ 234:cc71f96ac134
Combinar
author | juanjose.montesdeocaarbos |
---|---|
date | Tue, 04 Oct 2011 20:36:27 -0300 |
parents | 68b09c30b0d2 |
children |
rev | line source |
---|---|
137 | 1 using System; |
2 using NHibernate; | |
3 using NHibernate.Context; | |
4 | |
222
68b09c30b0d2
Separando los test de persistencia en un proyecto aparte
nelopauselli
parents:
137
diff
changeset
|
5 namespace Agendas.Repositories.Tests.Infraestructure |
137 | 6 { |
7 public class RequestEmulator : IDisposable | |
8 { | |
9 private readonly ISession _session; | |
10 | |
11 public RequestEmulator(ISessionFactory sessionFactory) | |
12 { | |
13 _session = sessionFactory.OpenSession(); | |
14 CurrentSessionContext.Bind(_session); | |
15 } | |
16 | |
17 public void Dispose() | |
18 { | |
19 _session.Flush(); | |
20 _session.Close(); | |
21 } | |
22 } | |
23 } |