public async Task <IActionResult> AddExp(string id, [FromBody] Experience_prof exp) { var user = await GetCandidat(id); if (user != null) { exp.candidat = user; _context.Add(exp); _context.SaveChanges(); return(Ok(new { exp = exp })); } return(NotFound()); }
public async Task <IActionResult> UpdateExp(int id, Experience_prof exp) { var experience = await _context.Experience_prof.FindAsync(id); if (experience != null) { experience.candidat = experience.candidat; experience.employeur = exp.employeur; experience.poste_occupe = exp.poste_occupe; experience.lieu_Exp = exp.lieu_Exp; experience.typeEmploi = exp.typeEmploi; experience.date_debut = exp.date_debut; experience.date_fin = exp.date_fin; experience.description = exp.description; _context.Entry(experience).State = EntityState.Modified; _context.SaveChanges(); return(Ok(new { updatedexp = experience })); } return(NotFound()); }