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

            return
                ((
                     DiseaseName == other.DiseaseName ||
                     DiseaseName != null &&
                     DiseaseName.Equals(other.DiseaseName)
                     ) &&
                 (
                     CountryName == other.CountryName ||
                     CountryName != null &&
                     CountryName.Equals(other.CountryName)
                 ) &&
                 (
                     Population == other.Population ||
                     Population != null &&
                     Population.Equals(other.Population)
                 ) &&
                 (
                     PrevalanceFactor == other.PrevalanceFactor ||
                     PrevalanceFactor != null &&
                     PrevalanceFactor.Equals(other.PrevalanceFactor)
                 ));
        }
Esempio n. 2
0
        public override bool Equals(Object obj)
        {
            if (obj == this)
            {
                return(true);
            }
            Type type = typeof(Disease);

            if (obj != null && obj.GetType() != type)
            {
                return(false);
            }

            var m = (Disease)obj;

            return(DiseaseName.Equals(m?.DiseaseName));
        }