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

            MasterFruta = await _context.MasterFruta.FirstOrDefaultAsync(m => m.Fruta_Id == id);

            if (MasterFruta == null)
            {
                return(NotFound());
            }
            return(Page());
        }
Beispiel #2
0
        public async Task <IActionResult> OnPostAsync(int?id)
        {
            if (id == null)
            {
                return(NotFound());
            }

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

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

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