UseTransaction() operator to automatically execute a query in a specific isolation level (e.g. split query)
- Dominant language
- C#
- Stars
- 14.8k
- Forks
- 3.4k
- PR merge metrics
- PR metrics pending
Description
I'm facing with something related to #33826. We are trying to adopt RCSI and Snapshot Isolation with specific cases.
Is there any quick extension method to wrap executed query in specified transaction with isolation level?
Something like this:
``` c#
// We have enabled READ_COMMITTED_SNAPSHOT Isolation
await _db.Table1
.UseTransaction(IsolationLevel.Snapshot)
.AsSplitQuery()
.Include(x => x.Table2)
.Include(x => x.Table3)
.Include(x => x.Table4).ThenInclude(x => x.Table4_1)
.Include(x => x.Table5)
.Where(...)
.ToListAsync(...);
```
Or maybe I could add this by some interceptor but i do now know which one?
UPDATE
@roji Overall, the idea behind this #30353 task isn't that bad? 😃
Contributor guide
Assessment
This issue has not been assessed yet.