annotate Agendas/trunk/src/Agendas.Repositories.Memory/EventoRepository.cs @ 12:05996fa19e04

Unificamos Van y Cafe en Evento Agenda.Publicar con los valores como parámetros independientes
author nelo@MTEySS.neluz.int
date Sun, 13 Mar 2011 19:50:17 -0300
parents 49b572535156
children 08b9e96132a5
rev   line source
2
c03560ae4762 Test de Crud para la agenda
nelopauselli
parents:
diff changeset
1 using System;
c03560ae4762 Test de Crud para la agenda
nelopauselli
parents:
diff changeset
2 using AltNetHispano.Agendas.Domain;
12
05996fa19e04 Unificamos Van y Cafe en Evento
nelo@MTEySS.neluz.int
parents: 4
diff changeset
3 using AltNetHispano.Agendas.Domain.Repositories;
2
c03560ae4762 Test de Crud para la agenda
nelopauselli
parents:
diff changeset
4
c03560ae4762 Test de Crud para la agenda
nelopauselli
parents:
diff changeset
5 namespace Agendas.Repositories.Memory
c03560ae4762 Test de Crud para la agenda
nelopauselli
parents:
diff changeset
6 {
12
05996fa19e04 Unificamos Van y Cafe en Evento
nelo@MTEySS.neluz.int
parents: 4
diff changeset
7 public class EventoRepository : RepositoryBase<Evento>, IEventoRepository
2
c03560ae4762 Test de Crud para la agenda
nelopauselli
parents:
diff changeset
8 {
c03560ae4762 Test de Crud para la agenda
nelopauselli
parents:
diff changeset
9 public void Save(Evento evento)
c03560ae4762 Test de Crud para la agenda
nelopauselli
parents:
diff changeset
10 {
c03560ae4762 Test de Crud para la agenda
nelopauselli
parents:
diff changeset
11 if (Guid.Empty.Equals(evento.Id))
c03560ae4762 Test de Crud para la agenda
nelopauselli
parents:
diff changeset
12 {
c03560ae4762 Test de Crud para la agenda
nelopauselli
parents:
diff changeset
13 evento.Id = Guid.NewGuid();
4
49b572535156 proponer van
nelopauselli
parents: 2
diff changeset
14 Objects.Add(evento.Id, evento);
2
c03560ae4762 Test de Crud para la agenda
nelopauselli
parents:
diff changeset
15 }
c03560ae4762 Test de Crud para la agenda
nelopauselli
parents:
diff changeset
16 }
c03560ae4762 Test de Crud para la agenda
nelopauselli
parents:
diff changeset
17
c03560ae4762 Test de Crud para la agenda
nelopauselli
parents:
diff changeset
18 public void Update(Evento evento)
c03560ae4762 Test de Crud para la agenda
nelopauselli
parents:
diff changeset
19 {
c03560ae4762 Test de Crud para la agenda
nelopauselli
parents:
diff changeset
20 //nada que hacer en este método para este repositorio
c03560ae4762 Test de Crud para la agenda
nelopauselli
parents:
diff changeset
21 }
c03560ae4762 Test de Crud para la agenda
nelopauselli
parents:
diff changeset
22
c03560ae4762 Test de Crud para la agenda
nelopauselli
parents:
diff changeset
23 public void Delete(Evento evento)
c03560ae4762 Test de Crud para la agenda
nelopauselli
parents:
diff changeset
24 {
4
49b572535156 proponer van
nelopauselli
parents: 2
diff changeset
25 Objects.Remove(evento.Id);
2
c03560ae4762 Test de Crud para la agenda
nelopauselli
parents:
diff changeset
26 }
12
05996fa19e04 Unificamos Van y Cafe en Evento
nelo@MTEySS.neluz.int
parents: 4
diff changeset
27
05996fa19e04 Unificamos Van y Cafe en Evento
nelo@MTEySS.neluz.int
parents: 4
diff changeset
28 public Evento Get(Guid vanId)
05996fa19e04 Unificamos Van y Cafe en Evento
nelo@MTEySS.neluz.int
parents: 4
diff changeset
29 {
05996fa19e04 Unificamos Van y Cafe en Evento
nelo@MTEySS.neluz.int
parents: 4
diff changeset
30 Evento evento;
05996fa19e04 Unificamos Van y Cafe en Evento
nelo@MTEySS.neluz.int
parents: 4
diff changeset
31 return Objects.TryGetValue(vanId, out evento) ? evento : null;
05996fa19e04 Unificamos Van y Cafe en Evento
nelo@MTEySS.neluz.int
parents: 4
diff changeset
32 }
05996fa19e04 Unificamos Van y Cafe en Evento
nelo@MTEySS.neluz.int
parents: 4
diff changeset
33
2
c03560ae4762 Test de Crud para la agenda
nelopauselli
parents:
diff changeset
34 }
c03560ae4762 Test de Crud para la agenda
nelopauselli
parents:
diff changeset
35 }