comparison 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
comparison
equal deleted inserted replaced
62:c40b97bbed01 63:963b71ea6028
1 using System.Collections.Generic;
2 using AltNetHispano.Agendas.Domain;
3 using AltNetHispano.Agendas.Domain.Repositories;
4 using NHibernate;
5
6 namespace AltNetHispano.Agendas.Repositories.NHibernate
7 {
8 public class PonenteRepository : RepositoryBase<Ponente>, IPonenteRepository
9 {
10 public PonenteRepository(ISessionFactory sessionFactory) : base(sessionFactory)
11 {
12 }
13
14 public IList<Ponente> GetAll()
15 {
16 return Session.QueryOver<Ponente>().List();
17 }
18
19 public Ponente GetByNombre(string ponenteNombre)
20 {
21 return Session.QueryOver<Ponente>().Where(p => p.Nombre == ponenteNombre).SingleOrDefault();
22 }
23 }
24 }