Browse Source

pass cancellation token

pull/7755/head
Ilkay Ilknur 6 years ago
parent
commit
d02412d2cc
  1. 7
      modules/cms-kit/src/Volo.CmsKit.Domain/Volo/CmsKit/Contents/ContentManager.cs

7
modules/cms-kit/src/Volo.CmsKit.Domain/Volo/CmsKit/Contents/ContentManager.cs

@ -20,12 +20,13 @@ namespace Volo.CmsKit.Contents
public async Task<Content> InsertAsync(Content content, CancellationToken cancellationToken = default) public async Task<Content> InsertAsync(Content content, CancellationToken cancellationToken = default)
{ {
if (await ContentRepository.ExistsAsync(content.EntityType, content.EntityId, content.TenantId, cancellationToken)) if (await ContentRepository.ExistsAsync(content.EntityType, content.EntityId, content.TenantId,
cancellationToken))
{ {
throw new ContentAlreadyExistException(content.EntityType, content.EntityId); throw new ContentAlreadyExistException(content.EntityType, content.EntityId);
} }
return await ContentRepository.InsertAsync(content); return await ContentRepository.InsertAsync(content, cancellationToken: cancellationToken);
} }
} }
} }
Loading…
Cancel
Save