comparison 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
comparison
equal deleted inserted replaced
64:240a20cdbcc8 67:c8099df941bd
1 using AltNetHispano.Agendas.Domain; 1 using Agendas.NHibernate;
2 using AltNetHispano.Agendas.Repositories.Memory; 2 using AltNetHispano.Agendas.Domain;
3 using AltNetHispano.Agendas.Repositories.NHibernate;
4 using NHibernate;
5
3 6
4 namespace AltNetHispano.Agendas.Factories 7 namespace AltNetHispano.Agendas.Factories
5 { 8 {
6 public static class AgendaFactory 9 public static class AgendaFactory
7 { 10 {
8 private static Agenda _agenda; 11 private static Agenda _agenda;
9 12
10 public static Agenda GetAgenda() 13 public static Agenda GetAgenda()
11 { 14 {
12 return _agenda ?? (_agenda = new Agenda(null, null, new EventoRepository(), new PonenteRepository())); 15 ISessionFactory sessionFactory = NhHelper.GetSessionFactory();
13 } 16 return _agenda ?? (_agenda = new Agenda(null, null, new EventoRepository(sessionFactory), new PonenteRepository(sessionFactory)));
14 } 17 }
18 }
15 } 19 }