comparison Agendas/trunk/src/Agendas.Factories/AgendaFactory.cs @ 100:cc91817a4206

Merge
author jorge.rowies
date Sat, 04 Jun 2011 22:46:06 -0300
parents db4b1e2cae49
children a456eb519e23
comparison
equal deleted inserted replaced
99:3027c64344bd 100:cc91817a4206
1 using Agendas.NHibernate; 1 using System;
2 using Agendas.NHibernate;
2 using AltNetHispano.Agendas.Domain; 3 using AltNetHispano.Agendas.Domain;
4 using AltNetHispano.Agendas.Domain.Repositories;
5 using AltNetHispano.Agendas.Domain.Services;
3 using AltNetHispano.Agendas.Repositories.NHibernate; 6 using AltNetHispano.Agendas.Repositories.NHibernate;
4 using NHibernate; 7 using NHibernate;
5 8
6 9
7 namespace AltNetHispano.Agendas.Factories 10 namespace AltNetHispano.Agendas.Factories
11 private static Agenda _agenda; 14 private static Agenda _agenda;
12 15
13 public static Agenda GetAgenda() 16 public static Agenda GetAgenda()
14 { 17 {
15 ISessionFactory sessionFactory = NhHelper.GetSessionFactory(); 18 ISessionFactory sessionFactory = NhHelper.GetSessionFactory();
16 return _agenda ?? (_agenda = new Agenda(null, new EventoRepository(sessionFactory), new PonenteRepository(sessionFactory))); 19 return _agenda ?? (_agenda = new Agenda(null, new EventoRepository(sessionFactory), new PersonaRepository(sessionFactory)));
20 }
21
22 public static IPersonaRepository GetPersonaRepository()
23 {
24 ISessionFactory sessionFactory = NhHelper.GetSessionFactory();
25 return new PersonaRepository(sessionFactory);
26 }
27
28 public static PersonaService GetPersonaService()
29 {
30 return new PersonaService(GetPersonaRepository());
17 } 31 }
18 } 32 }
19 } 33 }