annotate Agendas/trunk/src/Agendas.Repositories.NHibernate/RepositoryBase.cs @ 136:462a78196d11

Filtrado de eventos por estado
author nelopauselli
date Tue, 26 Jul 2011 14:33:49 -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 }