Mercurial > altnet-hispano
diff 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 |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/Agendas/trunk/src/Agendas.Repositories.NHibernate/PonenteRepository.cs Tue May 17 14:02:25 2011 -0300 @@ -0,0 +1,24 @@ +using System.Collections.Generic; +using AltNetHispano.Agendas.Domain; +using AltNetHispano.Agendas.Domain.Repositories; +using NHibernate; + +namespace AltNetHispano.Agendas.Repositories.NHibernate +{ + public class PonenteRepository : RepositoryBase<Ponente>, IPonenteRepository + { + public PonenteRepository(ISessionFactory sessionFactory) : base(sessionFactory) + { + } + + public IList<Ponente> GetAll() + { + return Session.QueryOver<Ponente>().List(); + } + + public Ponente GetByNombre(string ponenteNombre) + { + return Session.QueryOver<Ponente>().Where(p => p.Nombre == ponenteNombre).SingleOrDefault(); + } + } +} \ No newline at end of file