@ -8,6 +8,12 @@ namespace Volo.CmsKit.Contents
{
public interface IContentRepository : IBasicRepository<Content, Guid>
Task<Content> GetAsync(
[NotNull] string entityType,
[NotNull] string entityId,
Guid? tenantId = null,
CancellationToken cancellationToken = default);
Task<Content> FindAsync(
@ -13,6 +13,21 @@ namespace Volo.CmsKit.Contents
}
public Task<Content> GetAsync(
string entityType,
string entityId,
CancellationToken cancellationToken = default)
return GetAsync(x =>
!x.IsDeleted &&
x.EntityType == entityType &&
x.EntityId == entityId &&
x.TenantId == tenantId,
cancellationToken: cancellationToken
);
public Task<Content> FindAsync(
@ -13,6 +13,21 @@ namespace Volo.CmsKit.MongoDB.Contents