title: NPoco using LINQ where clauses in vb.net
body: <p>I am very interested in the use of LINQ in NPoco (microORM based on PetaPoco), which theoretically <a href="http://schotime.net/blog/index.php/2013/04/20/npoco-2-0/" rel="nofollow">can be used to specify simple where clauses</a>. I have been testing them in vb.net but I am not able to achieve the desired results.</p>
  
  <p><strong>Error details:</strong></p>
  
  <blockquote>
    <p>variable 'x' of type 'MyProjectName.App' referenced from scope '', but it is not defined.</p>
  </blockquote>
  
  <p><strong>Code:</strong></p>
  
  <pre><code>Imports NPoco
  Imports System.Configuration
  
  Public Class NPocoTest
  
      Public Sub doTest()
          Using db As IDatabase = New Database(ConfigurationManager.AppSettings("mydbconnectionstring"), NPoco.DatabaseType.MySQL)
              Dim app As App = db.FetchBy(Of App)(Function(sql) sql.Where(Function(x) x.name = "groupee")).FirstOrDefault
          End Using
      End Sub
  
  End Class
  
  Public Class App
      Public Property SID As Integer
      Public Property name As String
  End Class
  </code></pre>
  
  <p>Any ideas?</p>