I'm getting this error when I issue this:
DataContext.DBProjectEntities.Projects.Where(xWhere, parameterList.ToArray)
The command parameter syntax '@0' is not valid. Near line 6, column 37.
xWhere
is a string containing value "(ProjectStatuses.Any(DepartmentID = @0))"
parameterList
is Dim parameterList As New List(Of ObjectParameter)
It contains one element with value 1 of type Int32 which corresponds to the type of DepartmentID.
I got it. I was using the dunamic.vb from an external assembly. In my code I had imports statement for that assembly, but I also needed the imports for system.linq.dynamic