diff 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
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Agendas/trunk/src/Agendas.Repositories.Memory/EventoRepository.cs	Sat Jan 22 20:21:31 2011 -0300
@@ -0,0 +1,30 @@
+using System;
+using System.Collections.Generic;
+using AltNetHispano.Agendas.Domain;
+
+namespace Agendas.Repositories.Memory
+{
+	public abstract class EventoRepository
+	{
+		protected static readonly IDictionary<Guid, Evento> Eventos = new Dictionary<Guid, Evento>();
+
+		public void Save(Evento evento)
+		{
+			if (Guid.Empty.Equals(evento.Id))
+			{
+				evento.Id = Guid.NewGuid();
+				Eventos.Add(evento.Id, evento);
+			}
+		}
+
+		public void Update(Evento evento)
+		{
+			//nada que hacer en este método para este repositorio
+		}
+
+		public void Delete(Evento evento)
+		{
+			Eventos.Remove(evento.Id);
+		}
+	}
+}
\ No newline at end of file