view Agendas/trunk/src/Agendas.Repositories.Tests/Infraestructure/NhHelperTest.cs @ 301:771c2c805142

Puerto dinámico para el proyecto web.
author juanjose.montesdeocaarbos
date Mon, 27 Feb 2012 14:45:26 -0300
parents eeca9ddb330a
children
line wrap: on
line source

using Agendas.NHibernate;

namespace Agendas.Repositories.Tests.Infraestructure
{
	public static class NhHelperTest
	{
		public static void CleanDb()
		{
			var sf = NhHelper.GetSessionFactory();

			var session = sf.OpenStatelessSession();
			session.CreateSQLQuery("DELETE FROM Ponentes").ExecuteUpdate();
			session.CreateSQLQuery("DELETE FROM Patrocinadores").ExecuteUpdate();
			session.CreateSQLQuery("DELETE FROM Evento").ExecuteUpdate();
			session.CreateSQLQuery("DELETE FROM Patrocinador").ExecuteUpdate();
			session.CreateSQLQuery("DELETE FROM Roles").ExecuteUpdate();
			session.CreateSQLQuery("DELETE FROM Persona").ExecuteUpdate();
		}
	}
}