public LiteDBStorage(IOptions <CapOptions> capOptions, IOptions <LiteDBOptions> ldboption) { _capOptions = capOptions; _ldboption = ldboption.Value; _lite = new LiteDatabase(_ldboption.ConnectionString); PublishedMessages = _lite.GetCollection <LiteDBMessage>(nameof(PublishedMessages)); PublishedMessages.EnsureIndex(l => l.Id, true); ReceivedMessages = _lite.GetCollection <LiteDBMessage>(nameof(ReceivedMessages)); ReceivedMessages.EnsureIndex(l => l.Id, true); }