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

            Sanatci = await _context.Sanatci
                      .Include(s => s.Sehir).FirstOrDefaultAsync(m => m.ID == id);

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

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

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

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

            Sanatci = await _context.Sanatci
                      .Include(s => s.Sehir).FirstOrDefaultAsync(m => m.ID == id);

            if (Sanatci == null)
            {
                return(NotFound());
            }
            ViewData["SehirID"] = new SelectList(_context.Sehir, "ID", "SehirAdi");
            return(Page());
        }