personhelper.cs

来自「ibatis源码及帮助文档(IBatis源码+xsd+帮助)」· CS 代码 · 共 39 行

CS
39
字号
using System.Collections;

namespace iBatisTutorial.Model
{
	/// <summary>
	/// Helper class for Person entities.
	/// </summary>
	public class PersonHelper : Helper
	{
		public Person Select (int id)
		{
			return (Person) Mapper ().QueryForObject ("Select", id);
		}

		public IList SelectAll ()
		{
			return Mapper ().QueryForList ("Select", null);
		}

		public int Insert (Person person)
		{
			Mapper ().Insert ("Insert", person);
			// Insert is designed so that it can return the new key
			// but we are not utilizing that feature here
			return 1;
		}

		public int Update (Person person)
		{
			return Mapper ().Update ("Update", person);
		}

		public int Delete (int id)
		{
			return Mapper ().Delete ("Delete", id);
		}

	}
}

⌨️ 快捷键说明

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