public async Task <IActionResult> PutAcProfil([FromRoute] int id, [FromBody] AcProfil acProfil) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } if (id != acProfil.ProId) { return(BadRequest()); } _context.Entry(acProfil).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!AcProfilExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }
public async Task <IActionResult> PostAcProfil([FromBody] AcProfil acProfil) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } _context.AcProfil.Add(acProfil); await _context.SaveChangesAsync(); return(CreatedAtAction("GetAcProfil", new { id = acProfil.ProId }, acProfil)); }