title: To block some items in dropdown List
body: <p>I am working on MVC project and have a dropdown to fill with Country Name. But I want to block some country names so that they will not reflect in that dropdown. For blocked countries value of key should be listed in 'web.config' file. I do not want hard code. My current code is mentioned below. It will looks a little mixed up.</p>
  
  <p>Step 1</p>
  
  <pre><code>private static void FillCombos(GuestInformationPresenter model)
  {
      FillCountryLists(model);        
  }
  </code></pre>
  
  <p>Step 2 // This code is written in GuestInformation  Controller</p>
  
  <pre><code>/// &lt;summary&gt;
  /// Function to fill countries in combos.
  /// &lt;/summary&gt;
  /// &lt;param name="model"&gt;GuestInformationPresenter type of object&lt;/param&gt;
  private static void FillCountryLists(GuestInformationPresenter model)
  {
      //I want to add some Linq code here to Block some countries. 
      model.FillCountryLists(ReservationService.RetrieveCountries());
  }
  </code></pre>
  
  <p>Step 3 // This code is written in GuestInformation Presenter</p>
  
  <pre><code>public void FillCountryLists(Dictionary&lt;string, string&gt; countryList)
  {
      this.CountryList = countryList;
  }    
  </code></pre>
  
  <p>Step 4 // Function to retrieve collection of Countries.
      /// 
      /// collection of countries
      public static KeyValuePair[] RetrieveCountries()
      {
          return LookupManager.RetrieveCountries();
      }</p>
  
  <pre><code>public static Dictionary&lt;string, string&gt; RetrieveCountries()
  {
      KeyValuePair&lt;string, string&gt;[] countries = 
          CruiseLookup.RetrieveCountries();
      return countries.ToDictionary&lt;KeyValuePair&lt;string, string&gt;, string, string&gt;(pair =&gt; pair.Key, pair =&gt; pair.Value);
  }
  </code></pre>
  
  <p>Step 5 // This code is written in LookManager.cs</p>
  
  <pre><code>public static KeyValuePair&lt;string, string&gt;[] RetrieveCountries()
  {
      var countries = from LookupData.CountryRow countryRow in LookupManagerCache.Retrieve().CountryRows
      orderby countryRow.Name
      select new KeyValuePair&lt;string, string&gt;(
          DataField.RetrieveValue(() =&gt; countryRow.Code),
          DataField.RetrieveValue(() =&gt; countryRow.Name));
  
      return countries.ToArray();
  }
  </code></pre>
  
  <p>The method that does <code>return countries.ToArray();</code> (Step 5) is common to retrieve country list but when I want this list to bind GuestInformation Controller then I want to block those countries.</p>
  
  <p>Currently from step 4 I am getting key-value pair of different countries. For example if country is Guiena then Key-value pair from step 4 will be
  key='GU' value='GUIENA'</p>
  
  <p>After that in step 3  I am using this code to remove 'Guiena' country </p>
  
  <pre><code>public void FillCountryLists(Dictionary&lt;string, string&gt; countryList)
  {   
      countryList.remove(key="GU");
      countryList.remove(key="XYZ");  // Here XYZ is key of any other country
      this.CountryList = countryList;
  }
  </code></pre>
  
  <p><strong>But I want to add some LINQ or other code in step 2 (at controller level) to remove countries.</strong></p>
  
  <p><strong>The main thing that I want is that for blocked countries value of key should be listed in 'web.config' file</strong>. Can you please assist me to fix it?</p>