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

            tProvince = await _context.tProvince.SingleOrDefaultAsync(m => m.province_id == id);

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

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

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

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