public override bool Equals(Object obj)
        {
            if (obj == null || !(obj is PrimaryKeyColumn))
            {
                return(false);
            }

            PrimaryKeyColumn col = (PrimaryKeyColumn)obj;

            return(this.Name.Equals(col.Name) && this.Value.Equals(col.Value));
        }
예제 #2
0
        /// <summary>
        /// 获取所有的主键列。
        ///  <p>主键中包含的主键列的个数以及主键列的顺序与创建表时TableMeta中定义的一致。</p>
        /// </summary>
        /// <returns>The primary key columns.</returns>
        public PrimaryKeyColumn[] GetPrimaryKeyColumns()
        {
            if (this == null)
            {
                return(null);
            }

            PrimaryKeyColumn[] keyColumns = new PrimaryKeyColumn[this.Count];

            var enumerator = this.GetEnumerator();

            for (var i = 0; enumerator.MoveNext(); i++)
            {
                keyColumns[i] = new PrimaryKeyColumn(enumerator.Current);
            }

            return(keyColumns);
        }