diff Agendas/trunk/src/Agendas.Factories/AgendaFactory.cs @ 67:c8099df941bd

Implementando persistencia con NHibernate en el proyecto web
author nelopauselli
date Thu, 19 May 2011 01:24:56 -0300
parents 3ebe89c88caa
children 26d0513a8410
line wrap: on
line diff
--- a/Agendas/trunk/src/Agendas.Factories/AgendaFactory.cs	Tue May 17 16:59:39 2011 -0300
+++ b/Agendas/trunk/src/Agendas.Factories/AgendaFactory.cs	Thu May 19 01:24:56 2011 -0300
@@ -1,15 +1,19 @@
-using AltNetHispano.Agendas.Domain;
-using AltNetHispano.Agendas.Repositories.Memory;
+using Agendas.NHibernate;
+using AltNetHispano.Agendas.Domain;
+using AltNetHispano.Agendas.Repositories.NHibernate;
+using NHibernate;
+
 
 namespace AltNetHispano.Agendas.Factories
 {
-    public static class AgendaFactory
-    {
-    	private static Agenda _agenda;
+	public static class AgendaFactory
+	{
+		private static Agenda _agenda;
 
-        public static Agenda GetAgenda()
-        {
-            return _agenda ?? (_agenda = new Agenda(null, null, new EventoRepository(), new PonenteRepository()));
-        }
-    }
+		public static Agenda GetAgenda()
+		{
+			ISessionFactory sessionFactory = NhHelper.GetSessionFactory();
+			return _agenda ?? (_agenda = new Agenda(null, null, new EventoRepository(sessionFactory), new PonenteRepository(sessionFactory)));
+		}
+	}
 }
\ No newline at end of file