mirror of
https://github.com/dotnetcore/FreeSql.git
synced 2026-02-04 15:30:53 +08:00
Updated Unit of Work (markdown)
@@ -109,14 +109,15 @@ public enum EntityChangeType { Insert, Update, Delete, SqlRaw }
|
||||
| Delete | The entity object is deleted |
|
||||
| SqlRaw | SQL statement executed |
|
||||
|
||||
SqlRaw 目前有两处地方比较特殊:
|
||||
- 多对多联级更新导航属性的时候,对中间表的全部删除操作;
|
||||
- 通用仓储类 BaseRepository 有一个 Delete 方法,参数为表达式,而并非实体;
|
||||
SqlRaw currently has two special features:
|
||||
- When the navigation properties are updated in the many-to-many cascade, delete the relevant data in the intermediate table.
|
||||
- The common repository `BaseRepository` has a Delete method, and the parameter is an expression, not an entity.
|
||||
|
||||
```csharp
|
||||
int Delete(Expression<Func<TEntity, bool>> predicate);
|
||||
```
|
||||
|
||||
DbContext.SaveChanges,或者 Repository 对实体的 Insert/Update/Delete,或者 UnitOfWork.Commit 操作都会最多触发一次该事件。
|
||||
`DbContext.SaveChanges` or Repository's Insert/Update/Delete method of the entity, or `UnitOfWork.Commit` operation will trigger this event at most once.
|
||||
|
||||
## Reference
|
||||
|
||||
|
||||
Reference in New Issue
Block a user