Mercurial > altnet-hispano
comparison Agendas/trunk/src/Agendas.Repositories.NHibernate/EventoRepository.cs @ 63:963b71ea6028
Repositorios con NH
author | nelopauselli |
---|---|
date | Tue, 17 May 2011 14:02:25 -0300 |
parents | |
children | b74734a1a755 |
comparison
equal
deleted
inserted
replaced
62:c40b97bbed01 | 63:963b71ea6028 |
---|---|
1 using System; | |
2 using System.Collections.Generic; | |
3 using AltNetHispano.Agendas.Domain; | |
4 using AltNetHispano.Agendas.Domain.Repositories; | |
5 using NHibernate; | |
6 | |
7 namespace AltNetHispano.Agendas.Repositories.NHibernate | |
8 { | |
9 public class EventoRepository : RepositoryBase<Evento>, IEventoRepository | |
10 { | |
11 public EventoRepository(ISessionFactory sessionFactory) : base(sessionFactory) | |
12 { | |
13 } | |
14 | |
15 public void Delete(Evento evento) | |
16 { | |
17 Session.Delete(evento); | |
18 } | |
19 | |
20 public Evento Get(Guid vanId) | |
21 { | |
22 return Session.Get<Evento>(vanId); | |
23 } | |
24 | |
25 public IList<Evento> GetEventosConFecha() | |
26 { | |
27 return Session.QueryOver<Evento>().Where(e => e.Fecha != null).List(); | |
28 } | |
29 | |
30 public IList<Evento> GetEventosSinFecha() | |
31 { | |
32 return Session.QueryOver<Evento>().Where(e => e.Fecha == null).List(); | |
33 } | |
34 | |
35 public Evento GetPropuestaByTitulo(string titulo) | |
36 { | |
37 return Session.QueryOver<Evento>().Where(e => e.Titulo==titulo).SingleOrDefault(); | |
38 } | |
39 | |
40 public void Update(Evento evento) | |
41 { | |
42 //No es necesario implementarlo | |
43 } | |
44 } | |
45 } |