Question: I get the following Nhiberante error, but have no idea why:

> 
> could not execute query [ select attachment0\_.AttachmentId as
>  Attachme1\_9\_, attachment0\_.Name as Name9\_, attachment0\_.IconUrl as
>  IconUrl9\_, attachment0\_.UserId as UserId9\_,
>  attachment0\_.AttachmentTypeId as Attachme6\_9\_, attachment0\_.IsDeleted
>  as IsDeleted9\_, attachment0\_.ArrivalTime as ArrivalT8\_9\_,
>  attachment0\_.LocationId as LocationId9\_ from Attachment\_Attachment
>  attachment0\_ where attachment0\_.DYNAMIC\_TYPE='Attachment' and 1=0 ]
>  [SQL: select attachment0\_.AttachmentId as Attachme1\_9\_,
>  attachment0\_.Name as Name9\_, attachment0\_.IconUrl as IconUrl9\_,
>  attachment0\_.UserId as UserId9\_, attachment0\_.AttachmentTypeId as
>  Attachme6\_9\_, attachment0\_.IsDeleted as IsDeleted9\_,
>  attachment0\_.ArrivalTime as ArrivalT8\_9\_, attachment0\_.LocationId as
>  LocationId9\_ from Attachment\_Attachment attachment0\_ where
>  attachment0\_.DYNAMIC\_TYPE='Attachment' and 1=0]
> 
> 
> 

Update:

inner exception:

```
Failed to convert parameter value from a WhereSelectListIterator`2 to a Guid.

```

My query:

```
x => locationsIds.Contains(x.LocationId)

```

Answer: 
Check the `InnerException`. I'm sure it will point you to the correct place.
I know this specific question have been answered here, but I have also had this exception (with different column names) and the reason it failed was that I had used the wrong database. I had added a new table to one database, but when I ran the code I had configured it to use another database. Once I used the correct database the error disappeared. 

I hope this helps someone!