public IEnumerable <City> Find(string find, StringComparison stringComparison = StringComparison.OrdinalIgnoreCase) { var normalizedFind = _suffixdict.NormalizeString(find); foreach (var city in _suffixdict.GetDistinct(normalizedFind).Where(v => v.Name.IndexOf(normalizedFind, stringComparison) >= 0)) { yield return(city); } }
public IEnumerable <City> Find(string find) { var normalizedFind = _suffixdict.NormalizeString(find); foreach (var id in _suffixdict.Get(normalizedFind).Where(v => _cities[v].Name.IndexOf(normalizedFind, StringComparison.OrdinalIgnoreCase) >= 0)) { yield return(_cities[id]); } }