title: LINQ to XML - VB.NET to c#
body: <p>have the following in my project, written in VB.NET:</p>
  
  <pre><code> Dim items = From item In rssFeed.Elements("forecast").Elements("tabular").Elements("time") _
                      Select New WetherItem With {.time=item.Element("windDirection").Attribute("code").Value }
  </code></pre>
  
  <p>How is this written in C #?</p>
  
  <p>I have tried the following ...</p>
  
  <pre><code>XElement rssFeed = XElement.Load(@"http://www.yr.no/sted/Norge/Rogaland/Karm%C3%B8y/Torvastad/varsel.xml");
  var items = from item in rssFeed.Elements("forecast").Elements("tabular").Elements("time")
  select new WetherItem { .time=item.Element("windDirection").Attribute("code").Value };
  </code></pre>
  
  <p>But I get the error message from  </p>
  
  <blockquote>
    <p>rssFeed.Elements("forecast").Elements("tabular").Elements("time")</p>
    
    <p>Error 5   Could not find an implementation of the query pattern for
    source type
    'System.Collections.Generic.IEnumerable'. 
    'Select' not found.  Are you missing a reference or a using directive
    for 'System.Linq'?    c:\users\\documents\visual studio
    2012\Projects\Database1\Database1\SqlStoredProcedure1.cs  32  30  Database1</p>
  </blockquote>
  
  <p>I have reference to System.XML.Linq and System.Data.Linq</p>