diff Agendas/trunk/src/Agendas.Repositories.NHibernate/EventoRepository.cs @ 242:5cc1681d3789

Combinar
author juanjose.montesdeocaarbos
date Wed, 05 Oct 2011 07:57:21 -0300
parents 717fce60f200 51faeabfb9d9
children 70c5cab59054
line wrap: on
line diff
--- a/Agendas/trunk/src/Agendas.Repositories.NHibernate/EventoRepository.cs	Wed Oct 05 07:43:09 2011 -0300
+++ b/Agendas/trunk/src/Agendas.Repositories.NHibernate/EventoRepository.cs	Wed Oct 05 07:57:21 2011 -0300
@@ -1,8 +1,10 @@
 using System;
 using System.Collections.Generic;
+using System.Linq;
 using AltNetHispano.Agendas.Domain;
 using AltNetHispano.Agendas.Domain.Repositories;
 using NHibernate;
+using NHibernate.Linq;
 
 namespace AltNetHispano.Agendas.Repositories.NHibernate
 {
@@ -49,7 +51,7 @@
 
 	    public bool ExistePonente(Persona ponente)
 	    {
-            return Session.QueryOver<Evento>().Where(ev => ev.Ponente == ponente).RowCount() > 0;
+            return Session.Query<Evento>().Where(ev => ev.Ponentes.Contains(ponente)).Any();
 	    }
 
 	    public IList<Evento> GetByState(EventoState state)