Browse Source
Merge pull request #4704 from abpframework/liangshiwei/patch-1
Use CompleteAsync instead of SaveChangesAsync
pull/4715/head
maliming
6 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with
5 additions and
5 deletions
-
modules/audit-logging/src/Volo.Abp.AuditLogging.Domain/Volo/Abp/AuditLogging/AuditingStore.cs
-
modules/users/src/Volo.Abp.Users.Domain/Volo/Abp/Users/UserLookupService.cs
|
|
@ -57,8 +57,8 @@ namespace Volo.Abp.AuditLogging |
|
|
using (var uow = UnitOfWorkManager.Begin(true)) |
|
|
using (var uow = UnitOfWorkManager.Begin(true)) |
|
|
{ |
|
|
{ |
|
|
await AuditLogRepository.InsertAsync(new AuditLog(GuidGenerator, auditInfo)); |
|
|
await AuditLogRepository.InsertAsync(new AuditLog(GuidGenerator, auditInfo)); |
|
|
await uow.SaveChangesAsync(); |
|
|
await uow.CompleteAsync(); |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
@ -167,14 +167,14 @@ namespace Volo.Abp.Users |
|
|
filter, |
|
|
filter, |
|
|
cancellationToken |
|
|
cancellationToken |
|
|
); |
|
|
); |
|
|
|
|
|
|
|
|
return localUsers |
|
|
return localUsers |
|
|
.Cast<IUserData>() |
|
|
.Cast<IUserData>() |
|
|
.ToList(); |
|
|
.ToList(); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
public async Task<long> GetCountAsync( |
|
|
public async Task<long> GetCountAsync( |
|
|
string filter = null, |
|
|
string filter = null, |
|
|
CancellationToken cancellationToken = default) |
|
|
CancellationToken cancellationToken = default) |
|
|
{ |
|
|
{ |
|
|
if (ExternalUserLookupServiceProvider != null) |
|
|
if (ExternalUserLookupServiceProvider != null) |
|
|
@ -200,7 +200,7 @@ namespace Volo.Abp.Users |
|
|
using (var uow = _unitOfWorkManager.Begin(requiresNew: true)) |
|
|
using (var uow = _unitOfWorkManager.Begin(requiresNew: true)) |
|
|
{ |
|
|
{ |
|
|
await func(); |
|
|
await func(); |
|
|
await uow.SaveChangesAsync(); |
|
|
await uow.CompleteAsync(); |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|