Browse Source

CmsKit - Refactor Exists convension in Content

pull/6926/head
enisn 6 years ago
parent
commit
7497587d6e
  1. 2
      modules/cms-kit/src/Volo.CmsKit.Domain/Volo/CmsKit/Contents/ContentManager.cs
  2. 2
      modules/cms-kit/src/Volo.CmsKit.Domain/Volo/CmsKit/Contents/IContentRepository.cs
  3. 2
      modules/cms-kit/src/Volo.CmsKit.EntityFrameworkCore/Volo/CmsKit/Contents/EfCoreContentRepository.cs
  4. 2
      modules/cms-kit/src/Volo.CmsKit.MongoDB/Volo/CmsKit/MongoDB/Contents/MongoContentRepository.cs

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

@ -20,7 +20,7 @@ namespace Volo.CmsKit.Domain.Volo.CmsKit.Contents
public async Task<Content> InsertAsync(Content content, CancellationToken cancellationToken = default)
{
if (await ContentRepository.ExistAsync(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);
}

2
modules/cms-kit/src/Volo.CmsKit.Domain/Volo/CmsKit/Contents/IContentRepository.cs

@ -26,7 +26,7 @@ namespace Volo.CmsKit.Contents
Guid? tenantId = null,
CancellationToken cancellationToken = default);
Task<bool> ExistAsync(
Task<bool> ExistsAsync(
[NotNull] string entityType,
[NotNull] string entityId,
Guid? tenantId = null,

2
modules/cms-kit/src/Volo.CmsKit.EntityFrameworkCore/Volo/CmsKit/Contents/EfCoreContentRepository.cs

@ -58,7 +58,7 @@ namespace Volo.CmsKit.Contents
cancellationToken: GetCancellationToken(cancellationToken));
}
public async Task<bool> ExistAsync(
public async Task<bool> ExistsAsync(
[NotNull] string entityType,
[NotNull] string entityId,
Guid? tenantId = null,

2
modules/cms-kit/src/Volo.CmsKit.MongoDB/Volo/CmsKit/MongoDB/Contents/MongoContentRepository.cs

@ -54,7 +54,7 @@ namespace Volo.CmsKit.MongoDB.Contents
cancellationToken: GetCancellationToken(cancellationToken));
}
public async Task<bool> ExistAsync([NotNull] string entityType, [NotNull] string entityId, Guid? tenantId = null, CancellationToken cancellationToken = default)
public async Task<bool> ExistsAsync([NotNull] string entityType, [NotNull] string entityId, Guid? tenantId = null, CancellationToken cancellationToken = default)
{
return await (await GetMongoQueryableAsync()).AnyAsync(x =>
!x.IsDeleted &&

Loading…
Cancel
Save