annotate Agendas/trunk/src/Agendas.Repositories.NHibernate/RepositoryBase.cs @ 87:26d0513a8410

A los publicadores les llega la lista de tracks producidos en la acción realizada Quitamos el concepto de Recordador ya que el mismo es un publicador, cuándo publicar es responsabilidad de cada publicador
author nelopauselli
date Fri, 27 May 2011 14:42:38 -0300
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 }