Пример #1
0
        public async Task <IActionResult> OnGetAsync(int?id)
        {
            if (id == null)
            {
                return(NotFound());
            }

            Mekan = await _context.Mekan
                    .Include(m => m.Ilce)
                    .Include(m => m.Sehir).FirstOrDefaultAsync(m => m.ID == id);

            if (Mekan == null)
            {
                return(NotFound());
            }
            return(Page());
        }
Пример #2
0
        public async Task <IActionResult> OnPostAsync(int?id)
        {
            if (id == null)
            {
                return(NotFound());
            }

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

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

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

            Mekan = await _context.Mekan
                    .Include(m => m.Ilce)
                    .Include(m => m.Sehir).FirstOrDefaultAsync(m => m.ID == id);

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