static void Main(string[] args) { FileRepository fileRepository = new FileRepository(); fileRepository.Load("./Source.txt"); UrlValidator validator = new UrlValidator(); ILogger logger = LogManager.GetCurrentClassLogger(); UrlConverter converter = new UrlConverter(validator, logger); XmlSerializer xmlSerializer = new XmlSerializer(); xmlSerializer.Serialize(converter.Convert(fileRepository.Provide()), "./Result.txt"); Console.ReadLine(); }
public static ProductViewModel FromPrdouctDto(ProductCardDto dto) { var result = new ProductViewModel { ProductId = dto.Product.ProductId, Brand = new BrandViewModel { BrandId = dto.Brand.BrandId, Name = dto.Brand.Name }, Goodness = dto.Goodness, Link = dto.Product.Link, Price = dto.Product.Price, VendorCode = dto.Product.VendorCode, Sizes = dto.Sizes.Select(x => new SizeViewModel { SizeTypeId = x.SizeTypeId, RussianSize = x.RussianSize }) .ToList(), Photos = dto.ProductPhotos.Select(x => UrlConverter.Convert(x.PhotoUrl, ConvertedType.Product)).ToList() }; return(result); }
public override string ConvertUrl(string origin) { return(UrlConverter.Convert(origin)); }