title: Passing interface as a parameter to an extension method
body: <p>I have used extension methods to extend html helpers to make an RSS repeater:</p>
  
  <pre><code>    public static string RSSRepeater(this HtmlHelper html, IEnumerable&lt;IRSSable&gt; rss)
      {
          string result="";
  
          foreach (IRSSable item in rss)
          {
              result += "&lt;item&gt;" + item.GetRSSItem().InnerXml + "&lt;/item&gt;";
          }
  
          return result;
      }
  </code></pre>
  
  <p>So I make one of my business objects implement IRSSable, and try to pass this to the HTML helper. But I just cannot seem to make it work, I have tried:</p>
  
  <pre><code>&lt;%=Html.RSSRepeater(ViewData.Model.GetIssues(null, null, "") as IEnumerable&lt;IRSSable&gt;) %&gt;
  </code></pre>
  
  <p>Compiles fine, but null is passed</p>
  
  <pre><code>&lt;%=Html.RSSRepeater(ViewData.Model.GetIssues(null, null, "")) %&gt;
  </code></pre>
  
  <p>Intellisense moans about not being able to pass IEnumerable issue to IEnumberable IRSSable</p>
  
  <ul>
  <li>So how do you do it? That method I am calling definitly returns <code>IEnumberable&lt;Issue&gt;</code> and Issue definitly implements IRSSAble</li>
  </ul>