The query below does not work, if I take out line 2 it works and gives me
the full table, but when I try to select only those with a coutryId of 1 it
gives this error
LINQ to Entities does not recognize the method 'System.Object
CompareObjectEqual(System.Object, System.Object, Boolean)' method, and this
method cannot be translated into a store expression.
My experience tell me this is a problem with passing the wrong datatype, but
CountryId is an integer and even if I change it to a number 1 it still give
the same error.
Dim Q As ObjectQuery(Of emState) = CType((From c In em.emStateSet _
c.CountryReference.EntityKey.EntityKeyValues.First.Value = CountryId