⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 fixture.cs

📁 NHibernate NET开发者所需的
💻 CS
字号:
using System;
using System.Collections;
using System.Collections.Generic;

using NUnit.Framework;

namespace NHibernate.Test.GenericTest.Overall
{
	[TestFixture]
	[Ignore( "Generic entities not supported" )]
	public class Fixture : TestCase
	{
		protected override IList Mappings
		{
			get { return new string[] { "GenericTest.Overall.Mappings.hbm.xml" }; }
		}

		protected override string MappingsAssembly
		{
			get { return "NHibernate.Test"; }
		}

		[Test]
		public void CRUD()
		{
			A<int> entity = new A<int>();
			entity.Property = 10;
			entity.Collection = new List<int>();
			entity.Collection.Add( 20 );

			using( ISession session = OpenSession() )
			using( ITransaction transaction = session.BeginTransaction() )
			{
				session.Save( entity );
				transaction.Commit();
			}

			using( ISession session = OpenSession() )
			using( ITransaction transaction = session.BeginTransaction() )
			{
				session.Delete( entity );
				transaction.Commit();
			}
		}
	}
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -