/// <summary> /// <inheritdoc /> /// </summary> public async Task AddAsync(IBanner banner) { await _semaphoreSlim.WaitAsync(); try { var filter = Builders <BsonDocument> .Filter.Eq("_id", banner.Id); var result = await _databaseConnector.GetDataBaseClient().Find(filter).ToListAsync(); if (result.Count == 0) { var document = banner.ToBsonDocument(); await _databaseConnector.GetDataBaseClient().InsertOneAsync(document); } await UpdateAsync(banner); } catch (Exception e) { _logger.Log(e.Message); } finally { _semaphoreSlim.Release(); } }