public async Task UpdateAsync() { var productNames = _dataProdiver.GetProducts(); foreach (var productName in productNames) { try { _logger.LogInformation($"Getting subcases for {productName}..."); var subcases = (await _dataProdiver.GetSubcasesAsync(productName)).ToArray(); _logger.LogInformation($"{subcases.Count()} subcases for {productName}..."); var product = new Product { Id = GetHash(productName), Name = productName, ReportLink = _dataProdiver.GetReportLink(productName), Subcases = subcases.ToArray() }; await RegisterProductAsync(product); _logger.LogInformation($"Update complete for {productName}"); } catch (Exception error) { _logger.LogError(error, $"Error on updating subcases for {productName}"); } } }
public IEnumerable <string> GetProducts() { return(_dataProdiver.GetProducts()); }
public IEnumerable <string> Products() { logger_.LogInformation("Loading products..."); return(dataProdiver_.GetProducts()); }