c# - LINQ to Entities returning incorrect results for tables without primary key -


i have found linq entities needs primary key on table in order return correct results. without it, expected number of rows including duplicates (and accordingly, missed rows). problem described here , here, , consider bug.

in 1 of tables, each row unique cannot create compound key across fields because nullable columns cannot used in primary keys (again, consider sql server limitation).

so... how can correct results when selecting table using linq entities? believe "key" may create "entity key" across columns in visual studio model designer i'm not sure how this. setting entity key = true on nullable columns throws exception.

at 1 stage gave , added identity int column auto-increment enabled , used pk, solved issue, had throw out because of volume of data being deleted/inserted time (it's not possible reset auto-increment counter on schedule because not of rows deleted, causing clashes).

my last resort add bigint identity column pk, rid of auto-increment seed value resetter , hope lasts "long enough" life of application, i'm not comfortable this. (edit: ok... last long enough. main concern performance)


Comments

Popular posts from this blog

monitor web browser programmatically in Android? -

Shrink a YouTube video to responsive width -

wpf - PdfWriter.GetInstance throws System.NullReferenceException -