Entity Framework 4.1 DatabaseGeneratedOption.Identity Performance

后端 未结 2 1267
盖世英雄少女心
盖世英雄少女心 2021-01-17 05:38

I currently working on a application that use Entity Framework 4.1 (code first) and SQL Server CE 4.0. One of the new things I really like from SQL Server CE 4.0 are the com

相关标签:
2条回答
  • 2021-01-17 06:02

    Keep an ObjectContext / connection open for the liftime of your app. EF is not ideal for bulk inserts, use SqlCeResultSet for that for max perf.

    0 讨论(0)
  • 2021-01-17 06:06

    I decided to go the "generate my own key" way as a workaround. I added the required features for key generation to my DBContext class.

    If Microsoft change something on this behavior, I switch back to auto generation.

    0 讨论(0)
提交回复
热议问题