title: Linq to Sql convert to generic list in VB.NET
body: <p>I am trying to learn some VB.NET for my coo-op that starts next week, and for that reason i took my portfolio web site that is on C# and just started to converting it to VB.NET to get familiar with the syntax.</p>
  
  <p>I am sure my problem is simple however i have a hard time solving it.
  I am trying to grab data with the linq query and then return it as list to bind to the Repeater.</p>
  
  <p>I have the following function:</p>
  
  <pre><code>Public Function getProjects() As List(Of portfolio_website)
          Using myPortfolio As New PortfolioDataContext
              Try
  
                  Dim myProjects = (From p In myPortfolio.portfolio_websites _
                                    Order By p.website_id Descending _
                                    Select New With {.name = p.website_name, .id = p.website_id}).Take(5)
  
                  Return myProjects
  
              Catch ex As Exception
                  Return Nothing
              End Try
          End Using
      End Function
  </code></pre>
  
  <p>However I am getting an error.</p>
  
  <p>If i would do it in C# then myProjects will be <strong>var</strong>  and in return i will have </p>
  
  <pre><code>return myProjects.ToList();
  </code></pre>
  
  <p>And it would work fine. However if I try to use ToList() in VB.NET i am getting error that it cannot convert it from ling to sql List to the generic list.</p>
  
  <p>How do i do this convertion in VB.NET ? or maybe there is another way ?</p>
  
  <p>I am decent when it comes to C# however somewhat lost with the VB.NET syntax.</p>