예제 #1
0
        /// <summary>
        /// Returns true if RecipeObjectMetaImages instances are equal
        /// </summary>
        /// <param name="other">Instance of RecipeObjectMetaImages to be compared</param>
        /// <returns>Boolean</returns>
        public bool Equals(RecipeObjectMetaImages other)
        {
            if (ReferenceEquals(null, other))
            {
                return(false);
            }
            if (ReferenceEquals(this, other))
            {
                return(true);
            }

            return
                ((
                     ExtraLarge == other.ExtraLarge ||
                     ExtraLarge != null &&
                     ExtraLarge.Equals(other.ExtraLarge)
                     ) &&
                 (
                     Large == other.Large ||
                     Large != null &&
                     Large.Equals(other.Large)
                 ) &&
                 (
                     Standard == other.Standard ||
                     Standard != null &&
                     Standard.Equals(other.Standard)
                 ) &&
                 (
                     GridView == other.GridView ||
                     GridView != null &&
                     GridView.Equals(other.GridView)
                 ) &&
                 (
                     Small == other.Small ||
                     Small != null &&
                     Small.Equals(other.Small)
                 ) &&
                 (
                     Thumbnail == other.Thumbnail ||
                     Thumbnail != null &&
                     Thumbnail.Equals(other.Thumbnail)
                 ) &&
                 (
                     ExtraSmall == other.ExtraSmall ||
                     ExtraSmall != null &&
                     ExtraSmall.Equals(other.ExtraSmall)
                 ));
        }
예제 #2
0
 /// <summary>
 /// Gets the hash code
 /// </summary>
 /// <returns>Hash code</returns>
 public override int GetHashCode()
 {
     unchecked // Overflow is fine, just wrap
     {
         var hashCode = 41;
         // Suitable nullity checks etc, of course :)
         if (ExtraLarge != null)
         {
             hashCode = hashCode * 59 + ExtraLarge.GetHashCode();
         }
         if (Large != null)
         {
             hashCode = hashCode * 59 + Large.GetHashCode();
         }
         if (Standard != null)
         {
             hashCode = hashCode * 59 + Standard.GetHashCode();
         }
         if (GridView != null)
         {
             hashCode = hashCode * 59 + GridView.GetHashCode();
         }
         if (Small != null)
         {
             hashCode = hashCode * 59 + Small.GetHashCode();
         }
         if (Thumbnail != null)
         {
             hashCode = hashCode * 59 + Thumbnail.GetHashCode();
         }
         if (ExtraSmall != null)
         {
             hashCode = hashCode * 59 + ExtraSmall.GetHashCode();
         }
         return(hashCode);
     }
 }
예제 #3
0
        public List <ExtraLarge> HandwrittenExtraLarge()
        {
            if (connection.State == ConnectionState.Closed)
            {
                connection.Open();
            }

            using (var command = new SqlCommand(Sql, connection))
            {
                command.Parameters.Add(new SqlParameter("@p1", p1));
                command.Parameters.Add(new SqlParameter("@p2", p2));
                command.Parameters.Add(new SqlParameter("@p3", p3));
                command.Parameters.Add(new SqlParameter("@p4", p4));
                command.Parameters.Add(new SqlParameter("@p5", p5));
                command.Parameters.Add(new SqlParameter("@p6", p6));
                command.Parameters.Add(new SqlParameter("@p7", p7));
                command.Parameters.Add(new SqlParameter("@p8", p8));
                command.Parameters.Add(new SqlParameter("@p9", p9));
                command.Parameters.Add(new SqlParameter("@p10", p10));

                using (var reader = command.ExecuteReader(CommandBehavior.SingleResult | CommandBehavior.SequentialAccess))
                {
                    var result = new List <ExtraLarge>();

                    while (reader.Read())
                    {
                        var item = new ExtraLarge
                        {
                            Boolean  = reader.GetBoolean(0),
                            Byte     = reader.GetByte(1),
                            DateTime = reader.GetDateTime(2),
                            Decimal  = reader.GetDecimal(3),
                            Double   = reader.GetDouble(4),
                            Guid     = reader.GetGuid(5),
                            Int16    = reader.GetInt16(6),
                            Int32    = reader.GetInt32(7),
                            Int64    = reader.GetInt64(8),
                            Single   = reader.GetFloat(9),
                            String   = reader.GetString(10)
                        };

                        if (reader.IsDBNull(11) == false)
                        {
                            item.NullableBoolean = reader.GetBoolean(11);
                        }

                        if (reader.IsDBNull(12) == false)
                        {
                            item.NullableByte = reader.GetByte(12);
                        }

                        if (reader.IsDBNull(13) == false)
                        {
                            item.NullableDateTime = reader.GetDateTime(13);
                        }

                        if (reader.IsDBNull(14) == false)
                        {
                            item.NullableDecimal = reader.GetDecimal(14);
                        }

                        if (reader.IsDBNull(15) == false)
                        {
                            item.NullableDouble = reader.GetDouble(15);
                        }

                        if (reader.IsDBNull(16) == false)
                        {
                            item.NullableGuid = reader.GetGuid(16);
                        }

                        if (reader.IsDBNull(17) == false)
                        {
                            item.NullableInt16 = reader.GetInt16(17);
                        }

                        if (reader.IsDBNull(18) == false)
                        {
                            item.NullableInt32 = reader.GetInt32(18);
                        }

                        if (reader.IsDBNull(19) == false)
                        {
                            item.NullableInt64 = reader.GetInt64(19);
                        }

                        if (reader.IsDBNull(20) == false)
                        {
                            item.NullableSingle = reader.GetFloat(20);
                        }

                        if (reader.IsDBNull(21) == false)
                        {
                            item.NullableString = reader.GetString(21);
                        }

                        result.Add(item);
                    }

                    return(result);
                }
            }
        }