Posts

Showing posts from July, 2020

Product Feed

ProductFeed using FashionExchange.Common.BLL; using FashionExchange.Common.DAL; using FashionExchange.Common.Enums; using FashionExchange.Common.Utils; using log4net; using System; using System.Collections.Generic; using System.Linq; using System.Net; using System.Text; namespace FashionExchange.Common.ProductFeeds { public abstract class ProductFeed { protected ILog log { get { return LogManager.GetLogger(this.GetType().Name); } } protected Store Store { get { return StoreManager.GetStoreByScraperClassName(this.GetType().Name); } } protected virtual bool ProductSizeOnSeparateRow { get { return false; } } private HashSet _existingProductNames = null; protected HashSet ExistingProductNames { get { if (_existingProductNames == null) {...

Utility

StringUtil using System; using System.Collections.Generic; using System.IO; using System.Linq; using System.Security.Cryptography; using System.Text; namespace FashionExchange.Common.Utils { public class StringUtil { public static string SubstringFromStart(string value, string endStr, bool includeEndStr = false, bool ignoreCase = false) { int endIndex = ignoreCase ? value.IndexOf(endStr, StringComparison.CurrentCultureIgnoreCase) : value.IndexOf(endStr); if (endIndex == -1) return null; if (includeEndStr) endIndex += endStr.Length; return value.Substring(0, endIndex); } public static string SubstringToEnd(string value, string startStr, bool includeStartStr = false, bool ignoreCase = false) { int startIndex = ignoreCase ? value.IndexOf(startStr, StringComparison.InvariantCultureIgnoreCase) : value.IndexOf(startStr); if (startInde...