Example #1
0
        public IItemModel GetItemByKey(string key)
        {
            var model = new ThomannItemModel();

            model.Id = TmanRepo.Find(i => i == key);
            return(model);
        }
Example #2
0
        static async Task Start(string item, ISiteFactory factory, List <ThomannItemModel> list, Action <ThomannItemModel> a)
        {
            await Task.Run(() =>
            {
                var model = new ThomannItemModel()
                {
                    Prices = new Dictionary <string, string>()
                };
                model.Url = factory.CreateSwedishSite().ScrapeUrl(item);
                if (!string.IsNullOrEmpty(model.Url))
                {
                    model.Prices.Add("SEK", factory.CreateSwedishSite().ScrapeSwedishInfo(model.Url));
                    model.Prices.Add("DKK", factory.CreateDanishSite().ScrapeDanishInfo(model.Url.Replace("/se/", "/dk/")));
                    model.Prices.Add("NOK", factory.CreateNorwegianSite().ScrapeNorwegianInfo(model.Url.Replace("/se/", "/de/")));
                    model.Prices.Add("EUR", factory.CreateGermanSite().ScrapeGermanInfo(model.Url.Replace("/se/", "/de/")));

                    a(model);
                    list.Add(model);
                }
            });
        }