view Agendas/trunk/src/Agendas.Repositories.Tests/Infraestructure/NhHelperTest.cs @ 294:0e616662a94b

Added tag v1.1.0 for changeset 2cf7143586fe
author nelopauselli
date Fri, 17 Feb 2012 14:28:05 -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();
		}
	}
}