annotate Agendas/trunk/src/Agendas.Repositories.NHibernate/PonenteRepository.cs @ 63:963b71ea6028

Repositorios con NH
author nelopauselli
date Tue, 17 May 2011 14:02:25 -0300
parents
children db4b1e2cae49
rev   line source
63
963b71ea6028 Repositorios con NH
nelopauselli
parents:
diff changeset
1 using System.Collections.Generic;
963b71ea6028 Repositorios con NH
nelopauselli
parents:
diff changeset
2 using AltNetHispano.Agendas.Domain;
963b71ea6028 Repositorios con NH
nelopauselli
parents:
diff changeset
3 using AltNetHispano.Agendas.Domain.Repositories;
963b71ea6028 Repositorios con NH
nelopauselli
parents:
diff changeset
4 using NHibernate;
963b71ea6028 Repositorios con NH
nelopauselli
parents:
diff changeset
5
963b71ea6028 Repositorios con NH
nelopauselli
parents:
diff changeset
6 namespace AltNetHispano.Agendas.Repositories.NHibernate
963b71ea6028 Repositorios con NH
nelopauselli
parents:
diff changeset
7 {
963b71ea6028 Repositorios con NH
nelopauselli
parents:
diff changeset
8 public class PonenteRepository : RepositoryBase<Ponente>, IPonenteRepository
963b71ea6028 Repositorios con NH
nelopauselli
parents:
diff changeset
9 {
963b71ea6028 Repositorios con NH
nelopauselli
parents:
diff changeset
10 public PonenteRepository(ISessionFactory sessionFactory) : base(sessionFactory)
963b71ea6028 Repositorios con NH
nelopauselli
parents:
diff changeset
11 {
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 public IList<Ponente> GetAll()
963b71ea6028 Repositorios con NH
nelopauselli
parents:
diff changeset
15 {
963b71ea6028 Repositorios con NH
nelopauselli
parents:
diff changeset
16 return Session.QueryOver<Ponente>().List();
963b71ea6028 Repositorios con NH
nelopauselli
parents:
diff changeset
17 }
963b71ea6028 Repositorios con NH
nelopauselli
parents:
diff changeset
18
963b71ea6028 Repositorios con NH
nelopauselli
parents:
diff changeset
19 public Ponente GetByNombre(string ponenteNombre)
963b71ea6028 Repositorios con NH
nelopauselli
parents:
diff changeset
20 {
963b71ea6028 Repositorios con NH
nelopauselli
parents:
diff changeset
21 return Session.QueryOver<Ponente>().Where(p => p.Nombre == ponenteNombre).SingleOrDefault();
963b71ea6028 Repositorios con NH
nelopauselli
parents:
diff changeset
22 }
963b71ea6028 Repositorios con NH
nelopauselli
parents:
diff changeset
23 }
963b71ea6028 Repositorios con NH
nelopauselli
parents:
diff changeset
24 }