Beispiel #1
0
 public override int GetHashCode()
 {
     unchecked
     {
         var hashCode = ID.GetHashCode();
         hashCode = (hashCode * 397) ^ (StringDefault != null ? StringDefault.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ (String != null ? String.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ Int;
         hashCode = (hashCode * 397) ^ Long.GetHashCode();
         hashCode = (hashCode * 397) ^ Bool.GetHashCode();
         hashCode = (hashCode * 397) ^ Float.GetHashCode();
         hashCode = (hashCode * 397) ^ Double.GetHashCode();
         hashCode = (hashCode * 397) ^ (IntArray != null ? IntArray.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ (IntIList != null ? IntIList.GetHashCode() : 0);
         return(hashCode);
     }
 }
Beispiel #2
0
        /// <summary>
        /// 判断中间层对象值是否为Null
        /// </summary>
        /// <param name="instance"></param>
        /// <returns></returns>
        internal bool IsDefaultValue(object value)
        {
            if (value == null)
            {
                return(true);
            }

            switch (value.GetType().FullName)
            {
            case "System.Int16":
                if (Int16Default.Equals(value))
                {
                    return(true);
                }
                break;

            case "System.Int32":
                if (IntDefault.Equals(value))
                {
                    return(true);
                }
                break;

            case "System.Int64":
                if (Int64Default.Equals(value))
                {
                    return(true);
                }
                break;

            case "System.UInt16":
                if (UInt16Default.Equals(value))
                {
                    return(true);
                }
                break;

            case "System.UInt32":
                if (UInt32Default.Equals(value))
                {
                    return(true);
                }
                break;

            case "System.UInt64":
                if (UInt64Default.Equals(value))
                {
                    return(true);
                }
                break;

            case "System.Byte":
                if (ByteDefault.Equals(value))
                {
                    return(true);
                }
                break;

            case "System.Char":
                if (CharDefault.Equals(value))
                {
                    return(true);
                }
                break;

            case "System.DateTime":
                if (DateTimeDefault.Equals(value))
                {
                    return(true);
                }
                break;

            case "System.Decimal":
                if (DecimalDefault.Equals(value))
                {
                    return(true);
                }
                break;

            case "System.Double":
                if (DoubleDefault.Equals(value))
                {
                    return(true);
                }
                break;

            case "System.Single":
                if (SingleDefault.Equals(value))
                {
                    return(true);
                }
                break;

            case "System.String":
                if (StringDefault.Equals(value))
                {
                    return(true);
                }
                break;

            case "System.Guid":
                if (GuidDefault.Equals(value))
                {
                    return(true);
                }
                break;
                //case "System.Boolean":
                //default:
                //    break;
            }
            return(false);
        }