async Task <IWatchList> IWatchListsClient.GetPredefinedWatchListAsync(string watchListId)
        {
            try
            {
                var data = _readerWatchListCustomNoSql.Get(WatchListPredefinedNoSql.GeneratePartitionKey(), WatchListPredefinedNoSql.GenerateRowKey(watchListId));

                if (data != null)
                {
                    return(data);
                }
            }
            catch (Exception ex)
            {
                _log.Error(ex, $"Cannot read from MyNoSQL. Table: ${WatchListPredefinedNoSql.TableNamePredefinedWatchList}, PK: {WatchListPredefinedNoSql.GeneratePartitionKey()}, RK: {WatchListPredefinedNoSql.GenerateRowKey(watchListId)}", ex);
            }

            try
            {
                var result = await HttpClient.WatchListGetPredefinedAsync(watchListId);

                var data = FromWatchListResponse(result);
                return(data);
            }
            catch (Exception ex)
            {
                _log.Error(ex, $"Cannot read from API. Method: WatchListGetPredefinedAsync, watchListId: {watchListId}");
                throw;
            }
        }
Beispiel #2
0
        public async Task RemovePredefinedAsync(string watchListId)
        {
            await _predefinedWatchListRepository.RemoveAsync(watchListId);

            await _myNoSqlWriterPredefined.TryDeleteAsync(WatchListPredefinedNoSql.GeneratePartitionKey(), WatchListPredefinedNoSql.GenerateRowKey(watchListId));
        }