public static string discreption(this GoogleAttractions attraction) { switch (attraction) { case GoogleAttractions.AMUSE_PARK: return("amusement_park"); case GoogleAttractions.BAR: return("bar"); case GoogleAttractions.NIGHT_CLUB: return("night_club"); case GoogleAttractions.CASINO: return("casino"); default: throw new ArgumentOutOfRangeException("recipe category not supported"); } }
private string makeAttractionApiString(GoogleAttractions[] attractions) { string types = "&types="; var count = attractions.Count(); for (int i = 0; i < attractions.Count(); i++) { types += attractions[i].discreption(); if (!(i == attractions.Count() - 1)) // not the first and not the last { types += "|"; } } return types; }