Exemplo n.º 1
0
        public async Task <IActionResult> OnGetAsync(int?id)
        {
            if (id == null)
            {
                return(NotFound());
            }

            CurrencyRates = await _context.CurrencyRates.FirstOrDefaultAsync(m => m.ID == id);

            if (CurrencyRates == null)
            {
                return(NotFound());
            }
            return(Page());
        }
Exemplo n.º 2
0
        public async Task <IActionResult> OnPostAsync(int?id)
        {
            if (id == null)
            {
                return(NotFound());
            }

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

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

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