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

            Yazar = await _context.Yazar
                    .Include(y => y.Ulke).FirstOrDefaultAsync(m => m.ID == id);

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

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

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

            return(RedirectToPage("./Index"));
        }
예제 #3
0
        public async Task <IActionResult> OnGetAsync(int?id)
        {
            if (id == null)
            {
                return(NotFound());
            }

            Yazar = await _context.Yazar
                    .Include(y => y.Ulke).FirstOrDefaultAsync(m => m.ID == id);

            if (Yazar == null)
            {
                return(NotFound());
            }
            ViewData["UlkeID"] = new SelectList(_context.Ulke, "ID", "Isim");
            return(Page());
        }