@@ -52,7 +52,7 @@ public IQueryable<T> GetNoTrackingQueryable<T>()
52
52
public async Task < TEntity > AddAsync ( TEntity entity )
53
53
{
54
54
await Context . AddAsync ( entity ) ;
55
- await SaveEntitiesInternalAsync ( true ) ;
55
+ await SaveEntitiesInternalAsync ( ) ;
56
56
return entity ;
57
57
}
58
58
@@ -61,7 +61,7 @@ public async Task<TEnumerable> AddRangeAsync<TEnumerable>(TEnumerable entities)
61
61
where TEnumerable : IEnumerable < TEntity >
62
62
{
63
63
await Context . AddRangeAsync ( entities ) ;
64
- await SaveEntitiesInternalAsync ( true ) ;
64
+ await SaveEntitiesInternalAsync ( ) ;
65
65
return entities ;
66
66
}
67
67
@@ -80,22 +80,22 @@ public async Task<TEnumerable> AddRangeAsync<TEnumerable>(TEnumerable entities)
80
80
/// <inheritdoc />
81
81
public async Task < TEntity > UpdateAsync ( TEntity entity )
82
82
{
83
- await SaveEntitiesInternalAsync ( true ) ;
83
+ await SaveEntitiesInternalAsync ( ) ;
84
84
return entity ;
85
85
}
86
86
87
87
/// <inheritdoc />
88
88
public async Task < IEnumerable < TEntity > > UpdateRangeAsync ( IEnumerable < TEntity > entities )
89
89
{
90
- await SaveEntitiesInternalAsync ( true ) ;
90
+ await SaveEntitiesInternalAsync ( ) ;
91
91
return entities ;
92
92
}
93
93
94
94
/// <inheritdoc />
95
95
public async Task < TEntity > DeleteAsync ( TEntity entity )
96
96
{
97
97
Context . Remove ( entity ) ;
98
- await SaveEntitiesInternalAsync ( true ) ;
98
+ await SaveEntitiesInternalAsync ( ) ;
99
99
return entity ;
100
100
}
101
101
@@ -130,7 +130,7 @@ public async Task<int> SaveChangesAsync(CancellationToken cancellationToken = de
130
130
/// <inheritdoc />
131
131
public Task < bool > SaveEntitiesAsync ( CancellationToken cancellationToken = default )
132
132
{
133
- return SaveEntitiesInternalAsync ( false , cancellationToken ) ;
133
+ return SaveEntitiesInternalAsync ( true , cancellationToken ) ;
134
134
}
135
135
136
136
/// <summary>
@@ -145,7 +145,7 @@ protected virtual Task BeforeDispatchDomainEventAsync(List<DomainEvent> events,
145
145
}
146
146
147
147
private async Task < bool > SaveEntitiesInternalAsync (
148
- bool dispatchDomainEventFirst ,
148
+ bool dispatchDomainEventFirst = false ,
149
149
CancellationToken cancellationToken = default )
150
150
{
151
151
var entities = Context . ExtractDomainEventSources ( ) ;
0 commit comments