Exemplo n.º 1
0
        public async Task <IActionResult> OnGetAsync(int?id)
        {
            if (id == null)
            {
                return(NotFound());
            }

            JobPosition = await _context.JobPositions.FirstOrDefaultAsync(m => m.Id == id);

            if (JobPosition == null)
            {
                return(NotFound());
            }
            return(Page());
        }
Exemplo n.º 2
0
        public async Task <IActionResult> OnPostAsync(int?id)
        {
            if (id == null)
            {
                return(NotFound());
            }

            JobPosition = await _context.JobPositions.FindAsync(id);

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

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