Exemplo n.º 1
0
        public async Task Delete(int id)
        {
            var skillToDelete = await _context.Skills.FindAsync(id);

            if (skillToDelete != null)
            {
                _context.Skills.Remove(skillToDelete);
                await _context.SaveChangesAsync();
            }
        }
Exemplo n.º 2
0
        public async Task Delete(int id)
        {
            var candidateToDelete = await _context.FindAsync <Candidate>(id);

            if (candidateToDelete != null)
            {
                _context.Candidates.Remove(candidateToDelete);
                await _context.SaveChangesAsync();
            }
        }
Exemplo n.º 3
0
        public async Task <IActionResult> Create([Bind("Id,Name,BirthDate,EmailAddress,SalaryExpectations,Experience,Status,Observations,Curriculum_FileUrl")] Candidate candidate)
        {
            if (ModelState.IsValid)
            {
                _context.Add(candidate);
                await _context.SaveChangesAsync();

                return(RedirectToAction("Index"));
            }
            return(View(candidate));
        }