Ejemplo n.º 1
0
        public async Task CreateFrequencySummaryForDate(WRLDCWarehouseDbContext _context, DateTime dateTime)
        {
            // get the raw frequency data for the required date
            List <RawFrequency> rawFreqs = await _context.RawFrequencies.Where(rf => rf.DataTime.Date == dateTime.Date).ToListAsync();

            // transform the raw frequency data
            RawFrequencyTrasformation rawFrequencyTrasformation = new RawFrequencyTrasformation();
            MartDailyFrequencySummary martDailyFrequencySummary = rawFrequencyTrasformation.TransformDayFreq(rawFreqs);

            // load it to the mart
            LoadFrequencySummary loadFrequencySummary = new LoadFrequencySummary();
            await loadFrequencySummary.LoadDailyFrequencySummary(_context, martDailyFrequencySummary);
        }
Ejemplo n.º 2
0
        public async Task ProcessFrequenciesForDates(WRLDCWarehouseDbContext _context, string oracleConnStr, DateTime startDateTime, DateTime endDateTime)
        {
            if (startDateTime.Date >= endDateTime.Date)
            {
                return;
            }

            // run the job for each day
            foreach (DateTime day in DateUtils.EachDay(startDateTime, endDateTime))
            {
                RawFreqExtract      rawFreqExtract = new RawFreqExtract();
                List <RawFrequency> rawFreqs       = rawFreqExtract.ExtractRawFreqs(oracleConnStr, day, day);

                // transform the raw frequency data
                RawFrequencyTrasformation rawFrequencyTrasformation = new RawFrequencyTrasformation();
                MartDailyFrequencySummary martDailyFrequencySummary = rawFrequencyTrasformation.TransformDayFreq(rawFreqs);

                // load it to the mart
                LoadFrequencySummary loadFrequencySummary = new LoadFrequencySummary();
                await loadFrequencySummary.LoadDailyFrequencySummary(_context, martDailyFrequencySummary);
            }
        }