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

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

            if (Rental_services == null)
            {
                return(NotFound());
            }
            return(Page());
        }
Esempio n. 2
0
        public async Task <IActionResult> OnPostAsync(long?id)
        {
            if (id == null)
            {
                return(NotFound());
            }

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

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

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