Mercurial > altnet-hispano
comparison Agendas/trunk/src/Agendas.Repositories.NHibernate/EventoRepository.cs @ 237:51faeabfb9d9
Todos los tests en verde quitando al ponente principal
author | nelopauselli |
---|---|
date | Tue, 04 Oct 2011 21:30:55 -0300 |
parents | c61954d24c8c |
children | 5cc1681d3789 |
comparison
equal
deleted
inserted
replaced
236:04d6b386afa7 | 237:51faeabfb9d9 |
---|---|
2 using System.Collections.Generic; | 2 using System.Collections.Generic; |
3 using System.Linq; | 3 using System.Linq; |
4 using AltNetHispano.Agendas.Domain; | 4 using AltNetHispano.Agendas.Domain; |
5 using AltNetHispano.Agendas.Domain.Repositories; | 5 using AltNetHispano.Agendas.Domain.Repositories; |
6 using NHibernate; | 6 using NHibernate; |
7 using NHibernate.Linq; | |
7 | 8 |
8 namespace AltNetHispano.Agendas.Repositories.NHibernate | 9 namespace AltNetHispano.Agendas.Repositories.NHibernate |
9 { | 10 { |
10 public class EventoRepository : RepositoryBase<Evento>, IEventoRepository | 11 public class EventoRepository : RepositoryBase<Evento>, IEventoRepository |
11 { | 12 { |
48 //No es necesario implementarlo | 49 //No es necesario implementarlo |
49 } | 50 } |
50 | 51 |
51 public bool ExistePonente(Persona ponente) | 52 public bool ExistePonente(Persona ponente) |
52 { | 53 { |
53 return Session.QueryOver<Evento>().Where(ev => ev.Ponentes.Contains(ponente)).RowCount() > 0; | 54 return Session.Query<Evento>().Where(ev => ev.Ponentes.Contains(ponente)).Any(); |
54 } | 55 } |
55 | 56 |
56 public IList<Evento> GetByState(EventoState state) | 57 public IList<Evento> GetByState(EventoState state) |
57 { | 58 { |
58 return Session.QueryOver<Evento>().Where(e => e.Estado == state).List(); | 59 return Session.QueryOver<Evento>().Where(e => e.Estado == state).List(); |