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

            ServiceType = await _context.ServiceType.FirstOrDefaultAsync(m => m.ID == id);

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

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

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

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