///--------------------------------------------------------------------------------
        /// <summary>This method determines whether or not any metadata is
        /// different between the input instance and the current instance.</summary>
        ///
        /// <param name="inputPropertyBase">The propertybase to compare metadata.</param>
        ///--------------------------------------------------------------------------------
        public bool IsIdenticalMetadata(PropertyBase inputPropertyBase)
        {
            if (SolutionID.GetGuid() != inputPropertyBase.SolutionID.GetGuid())
            {
                return(false);
            }
            if (IsNullable.GetBool() != inputPropertyBase.IsNullable.GetBool())
            {
                return(false);
            }
            if (Order.GetInt() != inputPropertyBase.Order.GetInt())
            {
                return(false);
            }
            if (IsAutoUpdated.GetBool() != inputPropertyBase.IsAutoUpdated.GetBool())
            {
                return(false);
            }
            if (Description.GetString() != inputPropertyBase.Description.GetString())
            {
                return(false);
            }

            #region protected
            #endregion protected

            return(true);
        }
Esempio n. 2
0
 public override int GetHashCode()
 {
     unchecked
     {
         return((IsNullable.GetHashCode() * 397) ^ IsOptional.GetHashCode());
     }
 }
Esempio n. 3
0
 protected bool Equals(ColumnInfo other)
 {
     return(string.Equals(TableName, other.TableName) &&
            string.Equals(TableSchema, other.TableSchema) &&
            string.Equals(ColumnName, other.ColumnName) &&
            string.Equals(ColumnType, other.ColumnType) &&
            string.Equals(PropertyName, other.PropertyName) &&
            IsNullable.Equals(other.IsNullable) &&
            IsIdentity.Equals(other.IsIdentity) &&
            IndexType.Equals(other.IndexType));
 }
Esempio n. 4
0
 /// <summary>Fait office de fonction de hachage par défaut. </summary>
 /// <returns>Code de hachage pour l'objet actuel.</returns>
 /// <filterpriority>2</filterpriority>
 public override int GetHashCode()
 {
     unchecked
     {
         var hashCode = Ordinal;
         hashCode = (hashCode * 397) ^ IsNullable.GetHashCode();
         hashCode = (hashCode * 397) ^ (DbType != null ? DbType.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ (ColumnName != null ? ColumnName.GetHashCode() : 0);
         return(hashCode);
     }
 }
Esempio n. 5
0
 public override int GetHashCode()
 {
     unchecked
     {
         int hashCode = base.GetHashCode();
         hashCode = (hashCode * 397) ^ (DefaultValue != null ? DefaultValue.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ IsNullable.GetHashCode();
         hashCode = (hashCode * 397) ^ (DataType != null ? DataType.GetHashCode() : 0);
         return(hashCode);
     }
 }
        public override int GetSemanticHashCode(ExpressionEqualityComparer comparer)
        {
            unchecked
            {
                var hash = Alias.GetHashCode();

                hash = (hash * 16777619) ^ IsNullable.GetHashCode();

                return(hash);
            }
        }
Esempio n. 7
0
 /// <summary>
 /// 转成string
 /// </summary>
 /// <returns></returns>
 public override string ToString()
 {
     System.Text.StringBuilder sb = new System.Text.StringBuilder();
     sb.Append("PropertyName=\"" + FormatString(PropertyName) + "\",");
     sb.Append("ColumnName=\"" + FormatString(ColumnName) + "\",");
     sb.Append("IsNullable=" + IsNullable.ToString().ToLower() + ",");
     sb.Append("FieldType=" + Utility.ConvertFieldTypeToString(FieldType) + ",");
     sb.Append("FieldLength=" + FieldLength + ",");
     sb.Append("DefauleValue=\"" + FormatString(DefauleValue) + "\",");
     sb.Append("Remark=\"" + FormatString(Remark) + "\"");
     return(sb.ToString());
 }
Esempio n. 8
0
 public override int GetHashCode()
 {
     unchecked
     {
         var hashCode = ColumnName?.GetHashCode() ?? 0;
         hashCode = (hashCode * 397) ^ (MemberName?.GetHashCode() ?? 0);
         hashCode = (hashCode * 397) ^ (SystemType != null ? SystemType.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ IsNullable.GetHashCode();
         hashCode = (hashCode * 397) ^ (int)HandyType;
         return(hashCode);
     }
 }
Esempio n. 9
0
        public override int GetSemanticHashCode(ExpressionEqualityComparer comparer)
        {
            unchecked
            {
                var hash = IsNullable.GetHashCode();

                hash = (hash * 16777619) ^ comparer.GetHashCode(Expression);
                hash = (hash * 16777619) ^ (TypeMapping?.GetHashCode() ?? 0);

                return(hash);
            }
        }
Esempio n. 10
0
 public override int GetHashCode()
 {
     unchecked
     {
         var hashCode = (ColumnName != null ? ColumnName.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ (ColumnType != null ? ColumnType.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ IsNullable.GetHashCode();
         hashCode = (hashCode * 397) ^ HasDefaultValue.GetHashCode();
         hashCode = (hashCode * 397) ^ IsPrimaryKey.GetHashCode();
         return(hashCode);
     }
 }
Esempio n. 11
0
 public override int GetHashCode()
 {
     unchecked
     {
         var hashCode = (int)DbType;
         hashCode = (hashCode * 397) ^ Size;
         hashCode = (hashCode * 397) ^ IsStoredProcedureParameter.GetHashCode();
         hashCode = (hashCode * 397) ^ NoQuotes.GetHashCode();
         hashCode = (hashCode * 397) ^ IsNullable.GetHashCode();
         hashCode = (hashCode * 397) ^ (int)Direction;
         return(hashCode);
     }
 }
Esempio n. 12
0
 public override int GetHashCode()
 {
     unchecked
     {
         var hashCode = (int)SqlDataType;
         hashCode = (hashCode * 397) ^ (ColumnName != null ? ColumnName.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ IsNullable.GetHashCode();
         hashCode = (hashCode * 397) ^ (DataType != null ? DataType.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ IsAutoIncrement.GetHashCode();
         hashCode = (hashCode * 397) ^ MaxLength;
         return(hashCode);
     }
 }
Esempio n. 13
0
 public override int GetHashCode()
 {
     unchecked
     {
         int hashCode = (TableName != null ? TableName.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ (TableSchema != null ? TableSchema.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ (ColumnName != null ? ColumnName.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ (ColumnType != null ? ColumnType.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ (PropertyName != null ? PropertyName.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ IsNullable.GetHashCode();
         hashCode = (hashCode * 397) ^ IsIdentity.GetHashCode();
         hashCode = (hashCode * 397) ^ IndexType.GetHashCode();
         return(hashCode);
     }
 }
Esempio n. 14
0
        /// <summary>
        /// Returns the hash code for this object.
        /// </summary>
        /// <returns>A hash code for the current object.</returns>
        public override int GetHashCode()
        {
            int hashCode = -1182503711;

            hashCode = hashCode * -1521134295 + base.GetHashCode();
            hashCode = hashCode * -1521134295 + OrdinalPosition.GetHashCode();
            hashCode = hashCode * -1521134295 + EqualityComparer <string> .Default.GetHashCode(ColumnDefault);

            hashCode = hashCode * -1521134295 + IsNullable.GetHashCode();
            hashCode = hashCode * -1521134295 + EqualityComparer <string> .Default.GetHashCode(DataType);

            hashCode = hashCode * -1521134295 + MaxLength.GetHashCode();
            hashCode = hashCode * -1521134295 + NumericPrecision.GetHashCode();
            return(hashCode);
        }
Esempio n. 15
0
        public override int GetHashCode()
        {
            unchecked
            {
                int hashCode = (Type.GetHashCode() * 397)
                               ^ (Kind.GetHashCode() * 397)
                               ^ (IsNullable.GetHashCode() * 397);

                for (int i = 0; i < TypeArguments.Count; i++)
                {
                    hashCode ^= (TypeArguments[i].GetHashCode() * 397);
                }

                return(hashCode);
            }
        }
Esempio n. 16
0
 public override int GetHashCode()
 {
     // Courtesy of http://stackoverflow.com/a/263416
     unchecked                 // Overflow is fine, just wrap
     {
         // Note: Don't include the parameter size in the hash code, size is complicated (see the AreSizesEquivalent method for more info)
         var hash = (int)2166136261;
         hash = (hash * 16777619) ^ ParameterName.GetHashCode();
         hash = (hash * 16777619) ^ ((Value == null) ? 0 : Value.GetHashCode());
         hash = (hash * 16777619) ^ DbType.GetHashCode();
         hash = (hash * 16777619) ^ IsNullable.GetHashCode();
         hash = (hash * 16777619) ^ Direction.GetHashCode();
         hash = (hash * 16777619) ^ Scale.GetHashCode();
         return(hash);
     }
 }
Esempio n. 17
0
    /// <inheritdoc />
    void IPrintableExpression.Print(ExpressionPrinter expressionPrinter)
    {
        expressionPrinter.AppendLine(nameof(EntityShaperExpression) + ": ");
        using (expressionPrinter.Indent())
        {
            expressionPrinter.AppendLine(EntityType.Name);
            expressionPrinter.AppendLine(nameof(ValueBufferExpression) + ": ");
            using (expressionPrinter.Indent())
            {
                expressionPrinter.Visit(ValueBufferExpression);
                expressionPrinter.AppendLine();
            }

            expressionPrinter.Append(nameof(IsNullable) + ": ");
            expressionPrinter.AppendLine(IsNullable.ToString());
        }
    }
        /// <inheritdoc />
        public virtual void Print(ExpressionPrinter expressionPrinter)
        {
            Check.NotNull(expressionPrinter, nameof(expressionPrinter));

            expressionPrinter.AppendLine(nameof(EntityShaperExpression) + ": ");
            using (expressionPrinter.Indent())
            {
                expressionPrinter.AppendLine(EntityType.ToString());
                expressionPrinter.AppendLine(nameof(ValueBufferExpression) + ": ");
                using (expressionPrinter.Indent())
                {
                    expressionPrinter.Visit(ValueBufferExpression);
                    expressionPrinter.AppendLine();
                }

                expressionPrinter.Append(nameof(IsNullable) + ": ");
                expressionPrinter.AppendLine(IsNullable.ToString());
            }
        }
Esempio n. 19
0
        /// <inheritdoc/>
        public override int GetHashCode()
        {
            int hashCode = 17;

            unchecked
            {
                hashCode += Name.GetHashCode();
                hashCode *= 23;
                hashCode += DataType.GetHashCode();
                hashCode *= 23;
                hashCode += IsNullable.GetHashCode();
                hashCode *= 23;
                hashCode += IsIdentity.GetHashCode();
                hashCode *= 23;
                hashCode += IsReadOnly.GetHashCode();
            }

            return(hashCode);
        }
Esempio n. 20
0
        public PropertyField
        (
            string tableSchema
            , string tableName
            , string columnName
            , string dataType
            , int?length
            , int?numericScale
            , int?numericPrecision
            , object columnDefault
            , string columnText
            , string columnHeading
            , bool?isNullable
            , string hasDefault
            , bool isKey
        )
        {
            TableSchema      = tableSchema;
            TableName        = tableName;
            ColumnName       = columnName;
            IsNullable       = isNullable.GetValueOrDefault(true); //isNullable == "Y"; //none of them are nullable
            DataType         = dataType;                           //e.AsDb2Type().GetValueOrDefault(DB2Type.VARCHAR).AsCSharpType(IsNullable);
            Length           = length;
            NumericScale     = numericScale;
            NumericPrecision = numericPrecision;
            ColumnDefault    = columnDefault;
            ColumnText       = columnText;
            ColumnHeading    = columnHeading;
            IsKey            = isKey;
            HasDefault       = hasDefault == "Y";//.AsBoolean(); //all of our db2fields have defaults that I've seen

            ValidationAttributes = new ReadOnlyCollection <string>(new List <string>()
            {
                IsKey.AsKeyAttribute()
                , IsNullable.AsRequiredAttribute()
                , DataType.AsStringLengthAttribute(Length)
                , ColumnName.AsColumnAttribute()
            }.Where(s => !string.IsNullOrWhiteSpace(s)).ToList());
        }
Esempio n. 21
0
        /// <summary>
        /// Returns the hashcode for this <see cref="DbField"/>.
        /// </summary>
        /// <returns>The hashcode value.</returns>
        public override int GetHashCode()
        {
            if (m_hashCode != null)
            {
                return(m_hashCode.Value);
            }

            var hashCode = 0;

            // Set the hashcode
            hashCode = Name.GetHashCode() + IsPrimary.GetHashCode() + IsIdentity.GetHashCode() + IsNullable.GetHashCode();
            if (Type != null)
            {
                hashCode += Type.GetHashCode();
            }
            if (Size != null)
            {
                hashCode += Size.GetHashCode();
            }
            if (Precision != null)
            {
                hashCode += Precision.GetHashCode();
            }
            if (Scale != null)
            {
                hashCode += Scale.GetHashCode();
            }
            if (DatabaseType != null)
            {
                hashCode += DatabaseType.GetHashCode();
            }

            // Set and return the hashcode
            return((m_hashCode = hashCode).Value);
        }
Esempio n. 22
0
 public static bool ToBool(this IsNullable isNullable)
 {
     return(isNullable != IsNullable.No);
 }
Esempio n. 23
0
 protected bool Equals(ColumnEntity other)
 {
     return(base.Equals(other) && string.Equals(DefaultValue, other.DefaultValue) && IsNullable.Equals(other.IsNullable) && string.Equals(DataType, other.DataType));
 }