For Linq To Sql, you do not want either one. Use Object.Equals: .Where(b => Object.Equals(b.BoodschapID, id)
Why? Due to an error in the SQL generator if the identifier is a unique unique identifier. If you use b.BoodschapID.Equals (id) or b.BoodschapID == id and b.BoodschapID, this is a NULL pointer created by SQL will not be WHERE BoodschapID IS NULL , but rather WHERE BoodschapID = @p0 , which will not return any results .
I know for sure that EF had the same error. Think about whether she has decided yet. You can find more details in this question , just keep in mind that some answers generate horrific SQL.
Also, there is no difference between Equals and == in Linq To SQL that I know of.
Michael stum
source share