Skip to content

Commit 24ed954

Browse files
authored
add missing word; fix grammar (#5021)
1 parent 269b424 commit 24ed954

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

entity-framework/core/saving/execute-insert-update-delete.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,7 @@ As a result, it is usually a good idea to avoid mixing both tracked `SaveChanges
159159

160160
## Transactions
161161

162-
Continuing on the above, it's important to understand that `ExecuteUpdate` and `ExecuteDelete` do not implicitly start a transaction they're invoked. Consider the following code:
162+
Continuing on the above, it's important to understand that `ExecuteUpdate` and `ExecuteDelete` do not implicitly start a transaction when they're invoked. Consider the following code:
163163

164164
```c#
165165
await context.Blogs.ExecuteUpdateAsync(/* some update */);
@@ -170,7 +170,7 @@ blog.Rating += 2;
170170
await context.SaveChangesAsync();
171171
```
172172

173-
Each `ExecuteUpdate` call causes a single SQL `UPDATE` to be sent to the database. Since no transaction is created, if any sort of failure prevents the second `ExecuteUpdate` from completing successfully, the effects of the first one are still persisted to the database. In fact, the four operations above - two invocations of `ExecuteUpdate`, a query and `SaveChanges` - each executes within its own transaction. To wrap multiple operations in a single transaction, explicitly start a transaction with <xref:Microsoft.EntityFrameworkCore.Infrastructure.DatabaseFacade>:
173+
Each `ExecuteUpdate` call causes a single SQL `UPDATE` to be sent to the database. Since no transaction is created, if any sort of failure prevents the second `ExecuteUpdate` from completing successfully, the effects of the first one are still persisted to the database. In fact, the four operations above - two invocations of `ExecuteUpdate`, a query and `SaveChanges` - each execute within their own transaction. To wrap multiple operations in a single transaction, explicitly start a transaction with <xref:Microsoft.EntityFrameworkCore.Infrastructure.DatabaseFacade>:
174174

175175
```c#
176176
using (var transaction = context.Database.BeginTransaction())

0 commit comments

Comments
 (0)