/// <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(); } }
/// <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(); }
// ReSharper disable once UnusedMember.Global public static string CountryIdToString(CountryId x) => x.ToString();