notuniqueexception.cs

来自「工作流的基本资料(文档资料」· CS 代码 · 共 46 行

CS
46
字号
using System;

namespace NetBpm.Util.DB
{
	public class NotUniqueException : DbException
	{
		private int nbrOfObjectsFound;
		private String query = null;
		private Object[] values = null;

		public int NbrOfObjectsFound
		{
			get { return this.nbrOfObjectsFound; }
			set { this.nbrOfObjectsFound = value; }
		}

		public String Query
		{
			get { return this.query; }
			set { this.query = value; }
		}

		public Object[] Values
		{
			get { return this.values; }
			set { this.values = value; }
		}

		public NotUniqueException(String query, int nbrOfObjectsFound) : base("query returned " + nbrOfObjectsFound + " Objects instead of only 1 : " + query)
		{
			this.query = query;
		}

		public NotUniqueException(String query, Object valueObject, int nbrOfObjectsFound) : base("query returned " + nbrOfObjectsFound + " Objects instead of only 1 : " + query + " : " + valueObject)
		{
			this.query = query;
			this.values = new Object[] {valueObject};
		}

		public NotUniqueException(String query, Object[] values, int nbrOfObjectsFound) : base("query returned " + nbrOfObjectsFound + " Objects instead of only 1 : " + query + " : " + values)
		{
			this.query = query;
			this.values = values;
		}
	}
}

⌨️ 快捷键说明

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