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

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

            if (Yayinevi == null)
            {
                return(NotFound());
            }
            return(Page());
        }
        public async Task <IActionResult> OnPostAsync(int?id)
        {
            if (id == null)
            {
                return(NotFound());
            }

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

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

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