Browse Source

make methods virtual

pull/7755/head
Ilkay Ilknur 6 years ago
parent
commit
5d03d0e8c6
  1. 2
      modules/cms-kit/src/Volo.CmsKit.Admin.Application/Volo/CmsKit/Admin/Contents/ContentAdminAppService.cs
  2. 2
      modules/cms-kit/src/Volo.CmsKit.Domain/Volo/CmsKit/Contents/ContentManager.cs
  3. 8
      modules/cms-kit/src/Volo.CmsKit.EntityFrameworkCore/Volo/CmsKit/Contents/EfCoreContentRepository.cs
  4. 8
      modules/cms-kit/src/Volo.CmsKit.MongoDB/Volo/CmsKit/MongoDB/Contents/MongoContentRepository.cs

2
modules/cms-kit/src/Volo.CmsKit.Admin.Application/Volo/CmsKit/Admin/Contents/ContentAdminAppService.cs

@ -56,7 +56,7 @@ namespace Volo.CmsKit.Admin.Contents
return MapToGetOutputDto(entity);
}
public async Task<ContentDto> GetAsync(
public virtual async Task<ContentDto> GetAsync(
[NotNull] string entityType,
[NotNull] string entityId)
{

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

@ -18,7 +18,7 @@ namespace Volo.CmsKit.Contents
ContentRepository = contentRepository;
}
public async Task<Content> InsertAsync(Content content, CancellationToken cancellationToken = default)
public virtual async Task<Content> InsertAsync(Content content, CancellationToken cancellationToken = default)
{
if (await ContentRepository.ExistsAsync(content.EntityType, content.EntityId, content.TenantId,
cancellationToken))

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

@ -15,7 +15,7 @@ namespace Volo.CmsKit.Contents
{
}
public Task<Content> GetAsync(
public virtual Task<Content> GetAsync(
string entityType,
string entityId,
Guid? tenantId = null,
@ -29,7 +29,7 @@ namespace Volo.CmsKit.Contents
);
}
public Task<Content> FindAsync(
public virtual Task<Content> FindAsync(
string entityType,
string entityId,
Guid? tenantId = null,
@ -43,7 +43,7 @@ namespace Volo.CmsKit.Contents
);
}
public Task DeleteAsync(
public virtual Task DeleteAsync(
string entityType,
string entityId,
Guid? tenantId = null,
@ -56,7 +56,7 @@ namespace Volo.CmsKit.Contents
cancellationToken: GetCancellationToken(cancellationToken));
}
public async Task<bool> ExistsAsync(
public virtual async Task<bool> ExistsAsync(
[NotNull] string entityType,
[NotNull] string entityId,
Guid? tenantId = null,

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

@ -15,7 +15,7 @@ namespace Volo.CmsKit.MongoDB.Contents
{
}
public Task<Content> GetAsync(
public virtual Task<Content> GetAsync(
string entityType,
string entityId,
Guid? tenantId = null,
@ -29,7 +29,7 @@ namespace Volo.CmsKit.MongoDB.Contents
);
}
public Task<Content> FindAsync(
public virtual Task<Content> FindAsync(
string entityType,
string entityId,
Guid? tenantId = null,
@ -43,7 +43,7 @@ namespace Volo.CmsKit.MongoDB.Contents
);
}
public Task DeleteAsync(string entityType, string entityId, Guid? tenantId = null, CancellationToken cancellationToken = default)
public virtual Task DeleteAsync(string entityType, string entityId, Guid? tenantId = null, CancellationToken cancellationToken = default)
{
return DeleteAsync(x =>
x.EntityType == entityType &&
@ -52,7 +52,7 @@ namespace Volo.CmsKit.MongoDB.Contents
cancellationToken: GetCancellationToken(cancellationToken));
}
public async Task<bool> ExistsAsync([NotNull] string entityType, [NotNull] string entityId, Guid? tenantId = null, CancellationToken cancellationToken = default)
public virtual async Task<bool> ExistsAsync([NotNull] string entityType, [NotNull] string entityId, Guid? tenantId = null, CancellationToken cancellationToken = default)
{
return await (await GetMongoQueryableAsync(cancellationToken)).AnyAsync(x =>
x.EntityType == entityType &&

Loading…
Cancel
Save