Esempio n. 1
0
        public async Task OnGet()
        {
            string countySafe = County.Replace("-", " ").ToLower();
            string stateSafe  = State.Replace("-", " ").ToLower();

            County county = await _context.Counties
                            .Include(x => x.State)
                            .Include(x => x.Records)
                            .FirstOrDefaultAsync(x => x.CountyName.ToLower() == countySafe && x.State.StateName.ToLower() == stateSafe);

            if (county == null)
            {
                FlashMessage = $"State and county combination do not exist.";
            }
            else
            {
                county.Records = county.Records.OrderBy(x => x.Date).ToList();

                SiteSettings settings = await _context.SiteSettings.FirstAsync();

                var analysis = CountyProcessor.CountyProcess(county.Records);

                TargetCounty = county;
                Analysis     = analysis;
                SiteSettings = settings;
            }
        }