view Agendas/trunk/src/Agendas.Repositories.Tests/Infraestructure/NhInfraestrutureFactory.cs @ 274:72a96459f910

Ticket #123: Patrocinadores de las vans.
author juanjose.montesdeocaarbos
date Wed, 30 Nov 2011 08:56:01 -0300
parents 68b09c30b0d2
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);
		}
	}
}