Пример #1
0
        private void Scrape(int year)
        {
            var ufScraper = new UFScraper(year);

            ufScraper.Extract();
            UFs.AddRange(ufScraper.UFs);

            var dolarScraper = new DolarScraper(year);

            dolarScraper.Extract();
            Dolars.AddRange(dolarScraper.Dolars);

            //TODO: Scrape more historic data
            if (year > 2006)
            {
                var monthlyScraper = new MonthlyScraper(year);
                monthlyScraper.Extract();

                UTMs.AddRange(monthlyScraper.UTMs);
                UTAs.AddRange(monthlyScraper.UTAs);
                IPCPuntos.AddRange(monthlyScraper.IPCPuntos);
                IPCs.AddRange(monthlyScraper.IPCs);
                IPCAcumulado12UltimosMeses.AddRange(monthlyScraper.IPCAcumulado12Meses);
                IPCAcumuladoDelAno.AddRange(monthlyScraper.IPCAcumuladoAnos);
            }
        }
Пример #2
0
 public virtual void RemoveDuplicates(IndicatorsContext context)
 {
     UFs.RemoveAll(it => context.UFs.Any(saved => it.Date == saved.Date));
     Dolars.RemoveAll(it => context.Dolars.Any(saved => it.Date == saved.Date));
     UTMs.RemoveAll(it => context.UTMs.Any(saved => it.Date == saved.Date));
     UTAs.RemoveAll(it => context.UTAs.Any(saved => it.Date == saved.Date));
     IPCPuntos.RemoveAll(it => context.IPCPuntos.Any(saved => it.Date == saved.Date));
     IPCs.RemoveAll(it => context.IPCs.Any(saved => it.Date == saved.Date));
     IPCAcumulado12UltimosMeses.RemoveAll(it => context.IPCAcumulados12Meses.Any(saved => it.Date == saved.Date));
     IPCAcumuladoDelAno.RemoveAll(it => context.IPCAcumuladoAnos.Any(saved => it.Date == saved.Date));
 }