annotate Agendas/trunk/src/Agendas.Repositories.NHibernate/RepositoryBase.cs @ 134:a4ef6874ec81

Se termina prueba unitaria que verifica que se cree el evento solo si la acción es Agendar.
author alabra
date Sun, 17 Jul 2011 13:58:31 -0400
parents 963b71ea6028
children a2b14da4902f
rev   line source
63
963b71ea6028 Repositorios con NH
nelopauselli
parents:
diff changeset
1 using NHibernate;
963b71ea6028 Repositorios con NH
nelopauselli
parents:
diff changeset
2
963b71ea6028 Repositorios con NH
nelopauselli
parents:
diff changeset
3 namespace AltNetHispano.Agendas.Repositories.NHibernate
963b71ea6028 Repositorios con NH
nelopauselli
parents:
diff changeset
4 {
963b71ea6028 Repositorios con NH
nelopauselli
parents:
diff changeset
5 public class RepositoryBase<T>
963b71ea6028 Repositorios con NH
nelopauselli
parents:
diff changeset
6 {
963b71ea6028 Repositorios con NH
nelopauselli
parents:
diff changeset
7 private readonly ISessionFactory _sessionFactory;
963b71ea6028 Repositorios con NH
nelopauselli
parents:
diff changeset
8
963b71ea6028 Repositorios con NH
nelopauselli
parents:
diff changeset
9 public RepositoryBase(ISessionFactory sessionFactory)
963b71ea6028 Repositorios con NH
nelopauselli
parents:
diff changeset
10 {
963b71ea6028 Repositorios con NH
nelopauselli
parents:
diff changeset
11 _sessionFactory = sessionFactory;
963b71ea6028 Repositorios con NH
nelopauselli
parents:
diff changeset
12 }
963b71ea6028 Repositorios con NH
nelopauselli
parents:
diff changeset
13
963b71ea6028 Repositorios con NH
nelopauselli
parents:
diff changeset
14 protected ISession Session { get { return _sessionFactory.GetCurrentSession(); } }
963b71ea6028 Repositorios con NH
nelopauselli
parents:
diff changeset
15
963b71ea6028 Repositorios con NH
nelopauselli
parents:
diff changeset
16 public void Save(T obj)
963b71ea6028 Repositorios con NH
nelopauselli
parents:
diff changeset
17 {
963b71ea6028 Repositorios con NH
nelopauselli
parents:
diff changeset
18 Session.Save(obj);
963b71ea6028 Repositorios con NH
nelopauselli
parents:
diff changeset
19 }
963b71ea6028 Repositorios con NH
nelopauselli
parents:
diff changeset
20 }
963b71ea6028 Repositorios con NH
nelopauselli
parents:
diff changeset
21 }