public DocumentBuilder(CategoryServiceHelper categoryServiceHelper, DocumentBuilderSettings settings) { CategoryServiceHelper = categoryServiceHelper; Settings = settings; OffersTempFilePath = Path.Combine(Path.GetTempPath(), Path.GetTempFileName()); FinalTempFilePath = Path.Combine(Path.GetTempPath(), Path.GetTempFileName()); CategoriesForSave = new HashSet <DocumentBuilderVirtualCategory>(); }
/// <summary> /// выполняем проверки на возможность обработки текущего продукта и заносим его в дерево категорий. /// Если добавить в дерево не удалось, то продукт обрабатывать нельзя. В этом случае возращаем null /// </summary> /// <param name="productItem"></param> /// <returns></returns> protected int?CanWriteCurrentProductAndGetVirtualCategoryId(ProductItem productItem) { int?result = null; if (productItem != null && !SkipCurrentProduct(productItem)) { int?virtualCategoryId = CategoryServiceHelper.GetVirtualCategoryId(productItem, categoriesWithPhysAndVirtualIds); if (virtualCategoryId != null) { var currentCategory = ParentBuilder.AllCategories.SingleOrDefault(c => c.Id == virtualCategoryId.Value); if (currentCategory != null) { result = virtualCategoryId.Value; SaveCurrentCategoryPath(currentCategory); } } } return(result); }
/// <summary> /// Initializes a new instance of the <see cref="CategoryServiceTests" /> class. /// </summary> public CategoryServiceTests() { _categoryServiceHelper = new CategoryServiceHelper(); }
public YandexDocumentBuilder(CategoryServiceHelper categoryServiceHelper, DocumentBuilderSettings settings) : base(categoryServiceHelper, settings) { }