notclause.cs

来自「基于LINQ和.NET 3.5 的数据库源码」· CS 代码 · 共 46 行

CS
46
字号
using System;
using Lephone.Data.Dialect;
using Lephone.Data.SqlEntry;

namespace Lephone.Data.Builder.Clause
{
	[Serializable]
	public class NotClause : WhereCondition
	{
		private readonly WhereCondition _ic;

		public NotClause(WhereCondition ic)
		{
			_ic = ic;
		}

        public override bool SubClauseNotEmpty
        {
            get
            {
                if (_ic != null)
                {
                    return _ic.SubClauseNotEmpty;
                }
                return false;
            }
        }

        public override string ToSqlText(DataParamterCollection dpc, DbDialect dd)
		{
            if (_ic.SubClauseNotEmpty)
            {
                return string.Format("( Not ({0}) )", _ic.ToSqlText(dpc, dd));
            }
            return "";
		}

		/*
		public override string ToString()
		{
			return string.Format("( Not ({0}) )", _ic);
		}
		*/
	}
}

⌨️ 快捷键说明

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