|
|
|
@ -20,12 +20,13 @@ namespace Volo.CmsKit.Contents |
|
|
|
|
|
|
|
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); |
|
|
|
} |
|
|
|
|
|
|
|
return await ContentRepository.InsertAsync(content); |
|
|
|
return await ContentRepository.InsertAsync(content, cancellationToken: cancellationToken); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |