/// <summary> /// Scrapes the mapping between recipe url and recipe category. /// </summary> /// <param name="category">The recipe category.</param> private async Task ParseCategoryDetailsAsync(EatThisMuchCategory categoryPage) { do { var nextPageUrl = categoryPage.NextPage.ProperUrl; var currentPage = _pageFactory.Create <CategoryPage>(nextPageUrl); categoryPage = await _parseService .ParseAsync(currentPage) .CnfgAwait(); try { await _categoryRepo .AddAsync(categoryPage) .CnfgAwait(); _logger.ForContext(nameof(categoryPage), categoryPage, destructureObjects: true) .Information("EatThisMuch Category information added to Db"); } catch { _logger.Error("Failed adding Category info to DB"); } }while (!categoryPage.IsLastPage); }
public void RemoveRange(EatThisMuchCategory entities) { throw new System.NotImplementedException(); }
public async Task AddAsync(EatThisMuchCategory entity) { await _categories.InsertOneAsync(entity).CnfgAwait(); }