Browse Source

CmsKit - Code-formatting

pull/6926/head
enisn 6 years ago
parent
commit
dcc22cb1ef
  1. 2
      modules/cms-kit/src/Volo.CmsKit.Domain/Volo/CmsKit/Contents/ContentManager.cs
  2. 12
      modules/cms-kit/src/Volo.CmsKit.EntityFrameworkCore/Volo/CmsKit/Contents/EfCoreContentRepository.cs

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

@ -12,12 +12,12 @@ namespace Volo.CmsKit.Domain.Volo.CmsKit.Contents
public class ContentManager : DomainService, IContentManager
{
protected IContentRepository ContentRepository { get; }
public ContentManager(IContentRepository contentRepository)
{
ContentRepository = contentRepository;
}
public async Task<Content> InsertAsync(Content content, CancellationToken cancellationToken = default)
{
if (await ContentRepository.ExistAsync(content.EntityType, content.EntityId, content.TenantId, cancellationToken))

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

@ -45,7 +45,11 @@ namespace Volo.CmsKit.Contents
);
}
public Task DeleteAsync(string entityType, string entityId, Guid? tenantId = null, CancellationToken cancellationToken = default)
public Task DeleteAsync(
string entityType,
string entityId,
Guid? tenantId = null,
CancellationToken cancellationToken = default)
{
return DeleteAsync(x =>
x.EntityType == entityType &&
@ -54,7 +58,11 @@ namespace Volo.CmsKit.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> ExistAsync(
[NotNull] string entityType,
[NotNull] string entityId,
Guid? tenantId = null,
CancellationToken cancellationToken = default)
{
var dbSet = await GetDbSetAsync();
return await dbSet.AnyAsync(x =>

Loading…
Cancel
Save