Пример #1
0
        /// <summary>
        /// Assigns a key to the city, if it is filled.
        /// </summary>
        private void GenerateCityId()
        {
            string baseKey;

            if (CityName.HasValue())
            {
                baseKey = CountryId.ToString();
                if (StateId.HasValue)
                {
                    baseKey += StateId.Value.ToString();
                }
                baseKey += CityName;

                CityId = baseKey.ToMD5HashString();
            }
        }
Пример #2
0
        /// <summary>
        /// Assigns a key to the composeykey, to avoid duplicity.
        /// </summary>
        private void GenerateComposeKey()
        {
            string baseKey = CountryId.ToString();

            if (StateId.HasValue)
            {
                baseKey += StateId.Value.ToString();
            }

            if (CityId.HasValue())
            {
                baseKey += CityId;
            }

            baseKey += HolidayDate.Year.ToString();
            baseKey += HolidayDate.Month.ToString();
            baseKey += HolidayDate.Day.ToString();
            baseKey += HolidayType.Key.ToString();
            baseKey += NativeDescription;

            ComposeKey = baseKey.ToMD5HashString();
        }
Пример #3
0
 // ReSharper disable once UnusedMember.Global
 public static string CountryIdToString(CountryId x) => x.ToString();