示例#1
0
        private async Task DoBackGroundWork(JobParameters @params)
        {
            var instans = new Notifications();

#pragma warning disable CS4014
            Task.Run(async() =>
            {
                var ss    = new StoredSearch();
                var liste = await ss.GetAll();
                if (liste.Count > 0)
                {
                    var ws        = new ScraperFacade();
                    var vareListe = await ws.GetVareMultiSearch(liste, cts);
                    if (vareListe.Count > 0)
                    {
                        instans.SendNotification("Goods of interest found!", "Check out your Price Checker app " + vareListe.Count + " goods of interest");
                        vareListe.ForEach(async o =>
                        {
                            var cacheObj = new CachedVare {
                                MaxPris = o.MaxPris, MinPris = o.MinPris, Navn = o.Navn, Pris = o.Pris, Url = o.Url
                            };
                            if (!await cacheObj.DuplicateCheck())
                            {
                                await cacheObj.Save();
                            }
                        });
                    }
                }

                JobFinished(@params, false);
            }
                     );
#pragma warning restore CS4014
        }
示例#2
0
        private async Task DoBackGroundWork(JobParameters @params)
        {
#pragma warning disable CS4014
            Task.Run(async() =>
            {
                var ss    = new StoredSearch();
                var liste = await ss.GetAll();
                if (liste.Count > 0)
                {
                }

                JobFinished(@params, false);
            }
                     );
#pragma warning restore CS4014
        }