public async Task Delete(int id) { var skillToDelete = await _context.Skills.FindAsync(id); if (skillToDelete != null) { _context.Skills.Remove(skillToDelete); await _context.SaveChangesAsync(); } }
public async Task Delete(int id) { var candidateToDelete = await _context.FindAsync <Candidate>(id); if (candidateToDelete != null) { _context.Candidates.Remove(candidateToDelete); await _context.SaveChangesAsync(); } }
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)); }