|
|
|
@ -9,7 +9,6 @@ using System; |
|
|
|
using System.Collections.Generic; |
|
|
|
using System.Threading; |
|
|
|
using System.Threading.Tasks; |
|
|
|
using Microsoft.Extensions.Options; |
|
|
|
using MongoDB.Driver; |
|
|
|
using NodaTime; |
|
|
|
using Squidex.Domain.Apps.Core.Contents; |
|
|
|
@ -23,14 +22,12 @@ using Squidex.Domain.Apps.Events.Contents; |
|
|
|
using Squidex.Infrastructure; |
|
|
|
using Squidex.Infrastructure.Json; |
|
|
|
using Squidex.Infrastructure.Log; |
|
|
|
using Squidex.Infrastructure.MongoDb; |
|
|
|
using Squidex.Infrastructure.Queries; |
|
|
|
|
|
|
|
namespace Squidex.Domain.Apps.Entities.MongoDb.Contents |
|
|
|
{ |
|
|
|
public partial class MongoContentRepository : IContentRepository, IInitializable |
|
|
|
{ |
|
|
|
private readonly IMongoDatabase database; |
|
|
|
private readonly IAppProvider appProvider; |
|
|
|
private readonly IJsonSerializer serializer; |
|
|
|
private readonly ITextIndexer indexer; |
|
|
|
@ -46,13 +43,11 @@ namespace Squidex.Domain.Apps.Entities.MongoDb.Contents |
|
|
|
public MongoContentRepository(IMongoDatabase database, IAppProvider appProvider, IJsonSerializer serializer, ITextIndexer indexer, TypeNameRegistry typeNameRegistry) |
|
|
|
{ |
|
|
|
Guard.NotNull(appProvider, nameof(appProvider)); |
|
|
|
Guard.NotNull(database, nameof(database)); |
|
|
|
Guard.NotNull(serializer, nameof(serializer)); |
|
|
|
Guard.NotNull(indexer, nameof(indexer)); |
|
|
|
Guard.NotNull(typeNameRegistry, nameof(typeNameRegistry)); |
|
|
|
|
|
|
|
this.appProvider = appProvider; |
|
|
|
this.database = database; |
|
|
|
this.indexer = indexer; |
|
|
|
this.serializer = serializer; |
|
|
|
|
|
|
|
@ -140,10 +135,5 @@ namespace Squidex.Domain.Apps.Entities.MongoDb.Contents |
|
|
|
{ |
|
|
|
return contents.ClearAsync(); |
|
|
|
} |
|
|
|
|
|
|
|
public Task DeleteArchiveAsync() |
|
|
|
{ |
|
|
|
return database.DropCollectionAsync("States_Contents_Archive"); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|