title: lambda expressions in VB.NET... what am I doing wrong?
body: <p>when I run this C# code, no problems... but when I translate it into VB.NET it compiles but blows due to 'CompareString' member not being allowed in the expression... I feel like I'm missing something key here... </p>
  
  <pre><code>private void PrintButton_Click(object sender, EventArgs e)
  {
  if (ListsListBox.SelectedIndex &gt; -1)
  {
      //Context
      using (ClientOM.ClientContext ctx =
          new ClientOM.ClientContext(UrlTextBox.Text))
      {
          //Get selected list
          string listTitle = ListsListBox.SelectedItem.ToString();
          ClientOM.Web site = ctx.Web;
          ctx.Load(site,
              s =&gt; s.Lists.Where(l =&gt; l.Title == listTitle));
          ctx.ExecuteQuery();
  
          ClientOM.List list = site.Lists[0];
  
          //Get fields for this list
          ctx.Load(list,
              l =&gt; l.Fields.Where(f =&gt; f.Hidden == false 
        &amp;&amp; (f.CanBeDeleted == true || f.InternalName == "Title")));
          ctx.ExecuteQuery();
  
          //Get items for the list
       ClientOM.ListItemCollection listItems = list.GetItems(
        ClientOM.CamlQuery.CreateAllItemsQuery());
          ctx.Load(listItems);
          ctx.ExecuteQuery();
  
          // DOCUMENT CREATION CODE GOES HERE
  
      }
  
      MessageBox.Show("Document Created!");
  }
  </code></pre>
  
  <p>}</p>
  
  <p>but in VB.NET code this errors due to not being allowed 'CompareString' members in the ctx.Load() methods...</p>
  
  <pre><code>Private Sub PrintButton_Click(sender As Object, e As EventArgs)
      If ListsListBox.SelectedIndex &gt; -1 Then
          'Context
          Using ctx As New ClientOM.ClientContext(UrlTextBox.Text)
              'Get selected list
              Dim listTitle As String = ListsListBox.SelectedItem.ToString()
              Dim site As ClientOM.Web = ctx.Web
              ctx.Load(site, Function(s) s.Lists.Where(Function(l) l.Title = listTitle))
              ctx.ExecuteQuery()
  
              Dim list As ClientOM.List = site.Lists(0)
  
              'Get fields for this list
              ctx.Load(list, Function(l) l.Fields.Where(Function(f) f.Hidden = False AndAlso (f.CanBeDeleted = True OrElse f.InternalName = "Title")))
              ctx.ExecuteQuery()
  
              'Get items for the list
              Dim listItems As ClientOM.ListItemCollection = list.GetItems(ClientOM.CamlQuery.CreateAllItemsQuery())
              ctx.Load(listItems)
  
              ' DOCUMENT CREATION CODE GOES HERE
  
              ctx.ExecuteQuery()
          End Using
  
          MessageBox.Show("Document Created!")
      End If
  End Sub
  </code></pre>