view Agendas/trunk/src/Agendas.Repositories.Tests/Infraestructure/NhInfraestrutureFactory.cs @ 278:6f5ab71614d4

#125: ABM de patrocinadores.
author juanjose.montesdeocaarbos
date Wed, 21 Dec 2011 08:47:05 -0300
parents 72a96459f910
children
line wrap: on
line source

using System;
using Agendas.NHibernate;
using AltNetHispano.Agendas.Domain.Repositories;
using AltNetHispano.Agendas.Repositories.NHibernate;
using NHibernate;

namespace Agendas.Repositories.Tests.Infraestructure
{
	public class NhInfraestrutureFactory:IInfraestrutureFactory
	{
		private readonly ISessionFactory _sessionFactory;

		public NhInfraestrutureFactory()
		{
			_sessionFactory = NhHelper.GetSessionFactory();
		}
		public IEventoRepository GetEventoRepository()
		{
			return new EventoRepository(_sessionFactory);
		}

		public IPersonaRepository GetPonenteRepository()
		{
			return new PersonaRepository(_sessionFactory);
		}

		public IPatrocinadorRepository GetPatrocinadorRepository()
		{
			return new PatrocinadorRepository(_sessionFactory);
		}

		public Func<IDisposable> GetRequestEmulator()
		{
			return () => new RequestEmulator(_sessionFactory);
		}
	}
}