comparison Agendas/trunk/src/Agendas.Repositories.NHibernate/EventoRepository.cs @ 235:c61954d24c8c

Quitando ponente principal y utilizando siempre la lista de ponentes
author nelopauselli
date Tue, 04 Oct 2011 20:42:35 -0300
parents 7d838e7d83b3
children 51faeabfb9d9
comparison
equal deleted inserted replaced
231:e5959f3405e0 235:c61954d24c8c
1 using System; 1 using System;
2 using System.Collections.Generic; 2 using System.Collections.Generic;
3 using System.Linq;
3 using AltNetHispano.Agendas.Domain; 4 using AltNetHispano.Agendas.Domain;
4 using AltNetHispano.Agendas.Domain.Repositories; 5 using AltNetHispano.Agendas.Domain.Repositories;
5 using NHibernate; 6 using NHibernate;
6 7
7 namespace AltNetHispano.Agendas.Repositories.NHibernate 8 namespace AltNetHispano.Agendas.Repositories.NHibernate
47 //No es necesario implementarlo 48 //No es necesario implementarlo
48 } 49 }
49 50
50 public bool ExistePonente(Persona ponente) 51 public bool ExistePonente(Persona ponente)
51 { 52 {
52 return Session.QueryOver<Evento>().Where(ev => ev.Ponente == ponente).RowCount() > 0; 53 return Session.QueryOver<Evento>().Where(ev => ev.Ponentes.Contains(ponente)).RowCount() > 0;
53 } 54 }
54 55
55 public IList<Evento> GetByState(EventoState state) 56 public IList<Evento> GetByState(EventoState state)
56 { 57 {
57 return Session.QueryOver<Evento>().Where(e => e.Estado == state).List(); 58 return Session.QueryOver<Evento>().Where(e => e.Estado == state).List();