Linq Query keeps throwing “Unable to create a constant value of type System.Object….”, Why?

Use == instead of Equals:

where t.CustID == custIdToQuery

If the types are incorrect you may find that this doesn’t compile.

Leave a Comment