LINQ-to-SQL Bug: Using Property Name vs. DB Column Name for GUIDs
I came across this error today when working with my LINQ-to-SQL insert logic. "Invalid column name 'Id'." At first, I didn't understand why it was throwing this error because the source name was correct, "MyColumnRowGuid."
I had Auto-Sync set to OnInsert and Auto Generated set to True. I found out that it wasn't my fault, it's an actual bug with LINQ-to-SQL. It won't be fixed until .NET 4.0, so I am left to my own devices.
How did I get around this without changing the column name? I just had Linq use a sproc for the Insert method, generated the ID on the SQL side and returned it as a parameter.