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

            Candidato = await _context.Candidatos.FindAsync(id);

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

            return(RedirectToPage("./Index"));
        }
示例#2
0
        public async Task <IActionResult> OnGetAsync(Guid?id)
        {
            if (id == null)
            {
                return(NotFound());
            }

            Languages = htmlHelper.GetEnumSelectList <Language>();
            Grades    = htmlHelper.GetEnumSelectList <Grades>();

            Candidato = await _context.Candidatos
                        .Include(c => c.Job)
                        .Include(c => c.Competences)
                        .Include(c => c.JobExperiences)
                        .FirstOrDefaultAsync(m => m.Id == id);

            if (Candidato == null)
            {
                return(NotFound());
            }
            // ViewData["JobId"] = new SelectList(_context.Jobs, "Id", "Id");
            return(Page());
        }