public static string ToDomain(this HHotel hotel) { if (hotel == HHotel.Unknown) { throw new ArgumentException("Hotel cannot be 'Unknown'.", nameof(hotel)); } string value = hotel.ToString().ToLower(); return(value.Length != 5 ? value : value.Insert(3, ".")); }
public static string ToDomain(this HHotel hotel) { string outCome = hotel.ToString().ToLower(); if (hotel == HHotel.ComBr || hotel == HHotel.ComTr) { outCome = "com." + outCome.Substring(3, 2); } return(outCome); }
public static string ToRegion(this HHotel hotel) => hotel.ToString().ToLower();
/// <summary> /// Returns the domain associated with the specified <see cref="HHotel"/>. /// </summary> /// <param name="hotel">The <see cref="HHotel"/> that is associated with the wanted domain.</param> /// <returns></returns> public static string ToDomain(this HHotel hotel) { string value = hotel.ToString().ToLower(); return(value.Length != 5 ? value : value.Insert(3, ".")); }