title: How do I extend ADO.NET Entity Framework objects with partial classes?
body: <p>I've created a Visual Basic WPF Application project that contains Toy.edmx, an ADO.NET Entity Data Model generated from a database called Toy.</p>
  
  <p>Its <em>Window1.xaml.vb</em> file looks like this:</p>
  
  <pre>
  1   Class Window1
  2   
  3       Private Sub Window1_Loaded( _
  4       ByVal sender As System.Object, _
  5       ByVal e As System.Windows.RoutedEventArgs) _
  6       Handles MyBase.Loaded
  7   
  8           Dim dc As New ToyEntities1
  9           Label1.Content = (From c As Client In dc.ClientSet _
  10                            Select c).First.FirstName
  11  
  12      End Sub
  13  
  14  End Class
  </pre>
  
  <p>That runs just fine.</p>
  
  <p>But, if I add the file <em>Client.vb</em>...</p>
  
  <pre>
  1   Partial Public Class Client
  2       Function IsWashington() As Boolean
  3           Return Me.LastName = "Washington"
  4       End Function
  5   End Class
  </pre>
  
  <p>...and add a WHERE clause to my <em>Window1.xaml.vb</em> query...</p>
  
  <pre>
  9           Label1.Content = (From c As Client In dc.ClientSet _
  10                            Where c.IsWashington _
  11                            Select c).First.FirstName
  </pre>
  
  <p>...then I get this NotSupportedException:</p>
  
  <blockquote>
    <p>LINQ to Entities does not recognize the method 'Boolean IsWashington()' method, and this method cannot be translated into a store expression.</p>
  </blockquote>
  
  <p>How do I extend ADO.NET Entity Framework objects with partial classes?</p>