示例#1
0
        private string GetSuggestions(DataObjectCollection collection, string search)
        {
            var entities = collection.Where(t => t.name.ToLower().Contains(search.ToLower()))
                           .ToArray();

            if (entities == null || entities.Length <= 0)
            {
                return(null);
            }

            var suggestion = string.Join(", ", entities.Select(t => t.name));

            return(suggestion.Length > 64 ? suggestion.Substring(0, 64) + "..." : suggestion);
        }