title: Searching a collection effectively in c#
body: <p>I have an <code>AsyncObservable</code> collection of some class, say "dashboard". Each item inside dashboard collection contains a collection of some other class, say "chart". That chart has various properties such as name,type etc... I want to search based on chart name, type etc on this collection. Can anybody suggest me some searching technique? Currently I am searching by traversing the whole collection using a <code>foreach</code> and comparing entered input with each item inside the collection (this is not so efficient if amount of data is large)... I want to make it more efficient - I am using c#..</p>
  
  <p>My code is:</p>
  
  <pre><code>foreach (DashBoard item in this.DashBoards)   
    {  
     Chart obj1 = item.CurrentCharts.ToList().Find(chart =&gt;     chart.ChartName.ToUpper().Contains(searchText.ToUpper()));   
                      if (obj1 != null)  
                      {  
                          if (obj1.IsHighlighted != Colors.Wheat)  
                              obj1.IsHighlighted = Colors.Wheat;      
                          item.IsExpanded = true;   
                          flagList.Add(1);   
                      }  
                      else   
                      {    
                          flagList.Add(0);  
                  }    
      }
  </code></pre>