Ejemplo n.º 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());
        }
Ejemplo n.º 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"));
        }
Ejemplo n.º 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());
        }