Is LINQ to SQL too simple-minded?
I've been playing around with LINQ to SQL lately and I found an issue that I can't quite get my head around. Perhaps you can help.
As you know, there are times when you have database tables that don't have an identity field. The data typically is selected on a combination of conditions, often foreign keys and certain other data. While I'm not super anal about databases the way some people are, I don't see a need for the column or its index in these cases.
But LINQ to SQL insists on having it, or you can't even insert data. It tells you, "Can't perform Create, Update or Delete operations on 'Table(whatever)' because it has no primary key." Well, sure you can. I do all of the above on tables without primary keys. My initial suspicion is that this has to do with the concurrency checking, and I totally get that, but turning it off or rolling my own code has not changed anything. It still gives me this error. That, or I'm seriously missing something.
Yes, I know I could just add the column and move on, but it's not the right thing to do. Any suggestions?