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

            OtherNameType = await _context.OtherNameType.FirstOrDefaultAsync(m => m.OntId == id);

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

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

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

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