Added Get method to Content Repository

pull/6821/head
Ahmet 5 years ago
parent d0c58bb554
commit 98ed089d80

@ -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(
[NotNull] string entityType,
[NotNull] string entityId,

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

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

Loading…
Cancel
Save