Entity Framework WITH(NOLOCK)

EF本身不支持WITH(NOLOCK), 都指出建议设置事务的级别为允许脏读.

IsolationLevel = IsolationLevel.ReadUncommitted

http://stackoverflow.com/questions/926656/entity-framework-with-nolock

http://stackoverflow.com/questions/24684914/get-entity-framework-6-use-nolock-in-its-underneath-select-statements

 

Db First, Code First, Model First的区分

Db First:

从已有的数据库生成实体类

Code First:

先定义实体类,让后可以通过数据迁移(Data Migrations https://msdn.microsoft.com/zh-cn/data/jj554735)

Model First:

是通过VS提供的Model设计器来做模型设计.

Entity Framework问题总结-LMLPHP

05-11 18:02