public static List<T> ToListReadUncommitted<T>(this IQueryable<T> query) { using (var scope = new TransactionScope(TransactionScopeOption.Required, new TransactionOptions() { IsolationLevel = System.Transactions.IsolationLevel.ReadUncommitted })) { List<T> toReturn = query.ToList(); scope.Complete(); return toReturn; } } public static int CountReadUncommitted<T>(this IQueryable<T> query) { using (var scope = new TransactionScope(TransactionScopeOption.Required, new TransactionOptions() { IsolationLevel = System.Transactions.IsolationLevel.ReadUncommitted })) { int toReturn = query.Count(); scope.Complete(); return toReturn; } }
Entity Framework with nolock. 允許髒讀
相關文章
- Entity Framework Tutorial Basics(8):Types of Entity in Entity FrameworkFramework
- Entity Framework Tutorial Basics(20):Persistence in Entity FrameworkFramework
- Entity Framework Tutorial Basics(2):What is Entity Framework?Framework
- Entity Framework Tutorial Basics(29):Stored Procedure in Entity FrameworkFramework
- Entity Framework Tutorial Basics(3):Entity Framework ArchitectureFramework
- Entity Framework Tutorial Basics(4):Setup Entity Framework EnvironmentFramework
- Entity Framework Code-First(23):Entity Framework Power ToolsFramework
- Entity Framework(1)Framework
- entity framework in mysqlFrameworkMySql
- Entity Framework 教程Framework
- Entity Framework Tutorial Basics(33):Spatial Data type support in Entity Framework 5.0Framework
- Entity Framework Tutorial Basics(40):Validate EntityFramework
- Entity Framework Tutorial Basics(42):Colored EntityFramework
- Entity Framework Tutorial Basics(10):Entity LifecycleFramework
- Entity Framework Tutorial Basics(27):Update Entity GraphFramework
- Entity Framework Tutorial Basics(9):Entity RelationshipsFramework
- Entity Framework(實體框架)之Entity SQLFramework框架SQL
- Entity Framework Tutorial Basics(24):Update Single EntityFramework
- Entity Framework Tutorial Basics(25):Delete Single EntityFrameworkdelete
- Entity Framework Tutorial Basics(26):Add Entity GraphFramework
- Entity Framework Tutorial Basics(5):Create Entity Data ModelFramework
- Entity Framework+SQLite+DataBaseFirstFrameworkSQLiteDatabase
- Entity Framework Tutorial Basics(30):Framework
- Entity Framework使用心得Framework
- [hystar整理]Entity Framework 教程Framework
- Entity Framework Tutorial Basics(23):Add Single EntityFramework
- Entity Framework Core 2.0 入門Framework
- Entity Framework Core 2.0 新特性Framework
- Entity Framework問題總結Framework
- Entity Framework Code-First(10.2):Entity MappingsFrameworkAPP
- Entity Framework學習初級篇4--Entity SQLFrameworkSQL
- 髒讀,幻讀,不可重複讀
- Entity Framework版本歷史概覽Framework
- 重新認識了下Entity FrameworkFramework
- Entity Framework Tutorial Basics(32):Enum SupportFramework
- Entity Framework Tutorial Basics(35):Local DataFramework
- Entity Framework Tutorial Basics(41):Multiple DiagramsFramework
- Entity Framework 6.0 Tutorials(1):IntroductionFramework