annotate Agendas/trunk/src/Agendas.Repositories.Memory/EventoRepository.cs @ 2:c03560ae4762

Test de Crud para la agenda
author nelopauselli
date Sat, 22 Jan 2011 20:21:31 -0300
parents
children 49b572535156
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 System.Collections.Generic;
c03560ae4762 Test de Crud para la agenda
nelopauselli
parents:
diff changeset
3 using AltNetHispano.Agendas.Domain;
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 {
c03560ae4762 Test de Crud para la agenda
nelopauselli
parents:
diff changeset
7 public abstract class EventoRepository
c03560ae4762 Test de Crud para la agenda
nelopauselli
parents:
diff changeset
8 {
c03560ae4762 Test de Crud para la agenda
nelopauselli
parents:
diff changeset
9 protected static readonly IDictionary<Guid, Evento> Eventos = new Dictionary<Guid, 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 public void Save(Evento evento)
c03560ae4762 Test de Crud para la agenda
nelopauselli
parents:
diff changeset
12 {
c03560ae4762 Test de Crud para la agenda
nelopauselli
parents:
diff changeset
13 if (Guid.Empty.Equals(evento.Id))
c03560ae4762 Test de Crud para la agenda
nelopauselli
parents:
diff changeset
14 {
c03560ae4762 Test de Crud para la agenda
nelopauselli
parents:
diff changeset
15 evento.Id = Guid.NewGuid();
c03560ae4762 Test de Crud para la agenda
nelopauselli
parents:
diff changeset
16 Eventos.Add(evento.Id, evento);
c03560ae4762 Test de Crud para la agenda
nelopauselli
parents:
diff changeset
17 }
c03560ae4762 Test de Crud para la agenda
nelopauselli
parents:
diff changeset
18 }
c03560ae4762 Test de Crud para la agenda
nelopauselli
parents:
diff changeset
19
c03560ae4762 Test de Crud para la agenda
nelopauselli
parents:
diff changeset
20 public void Update(Evento evento)
c03560ae4762 Test de Crud para la agenda
nelopauselli
parents:
diff changeset
21 {
c03560ae4762 Test de Crud para la agenda
nelopauselli
parents:
diff changeset
22 //nada que hacer en este método para este repositorio
c03560ae4762 Test de Crud para la agenda
nelopauselli
parents:
diff changeset
23 }
c03560ae4762 Test de Crud para la agenda
nelopauselli
parents:
diff changeset
24
c03560ae4762 Test de Crud para la agenda
nelopauselli
parents:
diff changeset
25 public void Delete(Evento evento)
c03560ae4762 Test de Crud para la agenda
nelopauselli
parents:
diff changeset
26 {
c03560ae4762 Test de Crud para la agenda
nelopauselli
parents:
diff changeset
27 Eventos.Remove(evento.Id);
c03560ae4762 Test de Crud para la agenda
nelopauselli
parents:
diff changeset
28 }
c03560ae4762 Test de Crud para la agenda
nelopauselli
parents:
diff changeset
29 }
c03560ae4762 Test de Crud para la agenda
nelopauselli
parents:
diff changeset
30 }