Operator ‘==’ incompatible with operand types ‘Int32’ and ‘Object’

I had this error pop up on me recently. Operator ‘==’ incompatible with operand types ‘Int32’ and ‘Object’ I had an good grasp on why but the stack track would not tell me where! The issue is that a null object was being used in a where clause somewhere. Linq translated the null as “” and could not be compared the the ID field which is an int. My solution...

February 5th, 2009 by B.Harding