comparison Agendas/trunk/src/Agendas.Factories/AgendaFactory.cs @ 128:1e47bf408073

Asignacion de los publicadores configurados en web.config al factory de agenda (mediante CompositePublicador)
author jorge.rowies
date Mon, 04 Jul 2011 20:00:51 -0300
parents a456eb519e23
children
comparison
equal deleted inserted replaced
127:3700b77ed455 128:1e47bf408073
1 using Agendas.NHibernate; 1 using System.Collections.Generic;
2 using Agendas.NHibernate;
2 using AltNetHispano.Agendas.Domain; 3 using AltNetHispano.Agendas.Domain;
3 using AltNetHispano.Agendas.Domain.Repositories; 4 using AltNetHispano.Agendas.Domain.Repositories;
4 using AltNetHispano.Agendas.Domain.Services; 5 using AltNetHispano.Agendas.Domain.Services;
5 using AltNetHispano.Agendas.Repositories.NHibernate; 6 using AltNetHispano.Agendas.Repositories.NHibernate;
6 using AltNetHispano.Agendas.Twitter; 7 using AltNetHispano.Agendas.Twitter;
9 10
10 namespace AltNetHispano.Agendas.Factories 11 namespace AltNetHispano.Agendas.Factories
11 { 12 {
12 public static class AgendaFactory 13 public static class AgendaFactory
13 { 14 {
15 public static IPublicador Publicador { get; set; }
16
14 private static Agenda _agenda; 17 private static Agenda _agenda;
15 18
16 public static Agenda GetAgenda() 19 public static Agenda GetAgenda()
17 { 20 {
18 ISessionFactory sessionFactory = NhHelper.GetSessionFactory(); 21 ISessionFactory sessionFactory = NhHelper.GetSessionFactory();
19 return _agenda ?? 22 return _agenda ??
20 (_agenda = 23 (_agenda =
21 new Agenda(new TwitterPublicador(), new EventoRepository(sessionFactory), 24 new Agenda(Publicador, new EventoRepository(sessionFactory),
22 new PersonaRepository(sessionFactory))); 25 new PersonaRepository(sessionFactory)));
23 } 26 }
24 27
25 public static IPersonaRepository GetPersonaRepository() 28 public static IPersonaRepository GetPersonaRepository()
26 { 29 {