被各种exception折磨了一整天以后终于发现了问题所在
C#, entity framework, auto increment problem
http://stackoverflow.com/questions/3188194/c-entity-framework-auto-increment-problem
|
Check in your EDMX model, that the autoincrement field's StoreGeneratedPattern attribute is set to "Identity". In this way, EF knows that the autonumbers are handled by the DB. Here this is explained better: http://stackoverflow.com/questions/3011764/autonumber-with-entity-framework/3038265#3038265 |
Patch from MS
http://connect.microsoft.com/VisualStudio/Downloads/DownloadDetails.aspx?DownloadID=37957
浙公网安备 33010602011771号