Mercurial > altnet-hispano
view 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 |
line wrap: on
line source
using System; using Agendas.NHibernate; using AltNetHispano.Agendas.Domain; using AltNetHispano.Agendas.Domain.Repositories; using AltNetHispano.Agendas.Domain.Services; using AltNetHispano.Agendas.Repositories.NHibernate; 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(null, 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()); } } }