Mercurial > altnet-hispano
view Agendas/trunk/src/Agendas.Factories/AgendaFactory.cs @ 130:0ea32a748453
Se termina el publicador via el calendario de google, además se realizan las pruebas unitarias.
author | alabra |
---|---|
date | Sun, 10 Jul 2011 18:50:11 -0400 |
parents | a456eb519e23 |
children | 1e47bf408073 62791999ad01 |
line wrap: on
line source
using Agendas.NHibernate; using AltNetHispano.Agendas.Domain; using AltNetHispano.Agendas.Domain.Repositories; using AltNetHispano.Agendas.Domain.Services; using AltNetHispano.Agendas.Repositories.NHibernate; using AltNetHispano.Agendas.Twitter; using NHibernate; namespace AltNetHispano.Agendas.Factories { public static class AgendaFactory { private static Agenda _agenda; public static Agenda GetAgenda() { ISessionFactory sessionFactory = NhHelper.GetSessionFactory(); return _agenda ?? (_agenda = new Agenda(new TwitterPublicador(), new EventoRepository(sessionFactory), new PersonaRepository(sessionFactory))); } public static IPersonaRepository GetPersonaRepository() { ISessionFactory sessionFactory = NhHelper.GetSessionFactory(); return new PersonaRepository(sessionFactory); } public static PersonaService GetPersonaService() { return new PersonaService(GetPersonaRepository()); } } }