public async Task <ActionResult <BrancheTwo> > PostBrancheTwo(BrancheTwo brancheTwo) { _context.brancheTwos.Add(brancheTwo); await _context.SaveChangesAsync(); return(CreatedAtAction("GetBrancheTwo", new { id = brancheTwo.Id }, brancheTwo)); }
public async Task <IActionResult> PutBrancheTwo(int id, BrancheTwo brancheTwo) { if (id != brancheTwo.Id) { return(BadRequest()); } _context.Entry(brancheTwo).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!BrancheTwoExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }