Exemple #1
0
        public async Task <IActionResult> OnGetAsync(int?id)
        {
            if (id == null)
            {
                return(NotFound());
            }

            WeatherAudit = await _context.WeatherAudit.SingleOrDefaultAsync(m => m.Id == id);

            if (WeatherAudit == null)
            {
                return(NotFound());
            }
            return(Page());
        }
Exemple #2
0
        public async Task <IActionResult> OnPostAsync(int?id)
        {
            if (id == null)
            {
                return(NotFound());
            }

            WeatherAudit = await _context.WeatherAudit.FindAsync(id);

            if (WeatherAudit != null)
            {
                _context.WeatherAudit.Remove(WeatherAudit);
                await _context.SaveChangesAsync();
            }

            return(RedirectToPage("./Index"));
        }