Browse Source

Fix deleter.

pull/1066/head
Sebastian Stehle 2 years ago
parent
commit
39c9276177
  1. 2
      backend/src/Squidex.Domain.Apps.Entities.MongoDb/Assets/MongoShardedAssetRepository.cs
  2. 2
      backend/src/Squidex.Domain.Apps.Entities.MongoDb/Contents/MongoShardedContentRepository.cs
  3. 13
      backend/src/Squidex.Domain.Apps.Entities.MongoDb/Text/MongoShardedTextIndex.cs

2
backend/src/Squidex.Domain.Apps.Entities.MongoDb/Assets/MongoShardedAssetRepository.cs

@ -13,7 +13,7 @@ using Squidex.Infrastructure.States;
namespace Squidex.Domain.Apps.Entities.MongoDb.Assets;
public sealed class MongoShardedAssetRepository : ShardedSnapshotStore<MongoAssetRepository, Asset>, IAssetRepository
public sealed class MongoShardedAssetRepository : ShardedSnapshotStore<MongoAssetRepository, Asset>, IAssetRepository, IDeleter
{
public MongoShardedAssetRepository(IShardingStrategy sharding, Func<string, MongoAssetRepository> factory)
: base(sharding, factory)

2
backend/src/Squidex.Domain.Apps.Entities.MongoDb/Contents/MongoShardedContentRepository.cs

@ -18,7 +18,7 @@ using Squidex.Infrastructure.States;
namespace Squidex.Domain.Apps.Entities.MongoDb.Contents;
public sealed class MongoShardedContentRepository : ShardedSnapshotStore<MongoContentRepository, WriteContent>, IContentRepository
public sealed class MongoShardedContentRepository : ShardedSnapshotStore<MongoContentRepository, WriteContent>, IContentRepository, IDeleter
{
public MongoShardedContentRepository(IShardingStrategy sharding, Func<string, MongoContentRepository> factory)
: base(sharding, factory)

13
backend/src/Squidex.Domain.Apps.Entities.MongoDb/Text/MongoShardedTextIndex.cs

@ -13,7 +13,7 @@ using Squidex.Infrastructure.States;
namespace Squidex.Domain.Apps.Entities.MongoDb.Text;
public sealed class MongoShardedTextIndex<T> : ShardedService<MongoTextIndexBase<T>>, ITextIndex where T : class
public sealed class MongoShardedTextIndex<T> : ShardedService<MongoTextIndexBase<T>>, ITextIndex, IDeleter where T : class
{
public MongoShardedTextIndex(IShardingStrategy sharding, Func<string, MongoTextIndexBase<T>> factory)
: base(sharding, factory)
@ -52,4 +52,15 @@ public sealed class MongoShardedTextIndex<T> : ShardedService<MongoTextIndexBase
{
return Shard(app.Id).SearchAsync(app, query, scope, ct);
}
public async Task DeleteAppAsync(App app,
CancellationToken ct)
{
var shard = Shard(app.Id) as IDeleter;
if (shard != null)
{
await shard.DeleteAppAsync(app, ct);
}
}
}

Loading…
Cancel
Save