title: How do I search within a collection of type ConfigurationSection?
body: <p>If I have a collection that is of type ConfigurationSection, <strong>how do I search within the collection?</strong></p>
  
  <p>(I am a C# noob and hobbyist)</p>
  
  <p>I have this class:</p>
  
  <p>(from <a href="http://net.tutsplus.com/tutorials/asp-net/how-to-add-custom-configuration-settings-for-your-asp-net-application/" rel="nofollow">http://net.tutsplus.com/tutorials/asp-net/how-to-add-custom-configuration-settings-for-your-asp-net-application/</a>)</p>
  
  <pre><code>public class FeedRetrieverSection : ConfigurationSection  
  {  
    [ConfigurationProperty("feeds", IsDefaultCollection =   
    public FeedElementCollection Feeds
      {  
        get { return (FeedElementCollection)this["feeds"]; }  
        set { this["feeds"] = value; }  
      }  
  }
  </code></pre>
  
  <p>I see how to iterate through it using a "for each" based on this declaration of _Config:</p>
  
  <pre><code>public static FeedRetrieverSection _Config =  
          ConfigurationManager.GetSection("feedRetriever") as FeedRetrieverSection; 
  </code></pre>
  
  <p><strong>What I cannot figure out: How do I search for a given name within the collection?</strong></p>
  
  <p>Using the declaration of _Config, as shown above, I would want to use linq or a dictionary to just get a single "record" from this list of <code>&lt;feeds&gt;</code> ?</p>
  
  <p>Full stack:</p>
  
  <p>Web config has this in it:</p>
  
  <pre><code>&lt;feedRetriever&gt;  
      &lt;feeds&gt;  
          &lt;add name="Nettuts+" url="http://feeds.feedburner.com/nettuts" cache="false"/&gt;  
          &lt;add name="Jeremy McPeak" url="http://www.wdonline.com/feeds/blog/rss/" /&gt;  
          &lt;add name="Nicholas C. Zakas" url="http://feeds.nczonline.net/blog/" /&gt;  
      &lt;/feeds&gt;  
  &lt;/feedRetriever&gt;  
  </code></pre>
  
  <p>Which is represented in code this way:</p>
  
  <pre><code>public class FeedElement : ConfigurationElement  
  {  
      [ConfigurationProperty("name", IsKey = true, IsRequired = true)]  
      public string Name  
      {  
          get { return (string)this["name"]; }  
          set { this["name"] = value; }  
      }  
  
      // etc for all of the elements...
  }
  </code></pre>
  
  <p>Which is wrapped in a ConfigurationElementCollection like so:</p>
  
  <pre><code>[ConfigurationCollection(typeof(FeedElement))]  
  public class FeedElementCollection : ConfigurationElementCollection  
  {  
      protected override ConfigurationElement CreateNewElement()  
      {  
          return new FeedElement();  
      }  
  
      protected override object GetElementKey(ConfigurationElement element)  
      {  
          return ((FeedElement)element).Name;  
      }  
  }  
  </code></pre>