public async Task <ActionResult <typeUnite> > PosttypeUnite(typeUnite typeUnite) { _context.typeUnites.Add(typeUnite); await _context.SaveChangesAsync(); return(CreatedAtAction("GettypeUnite", new { id = typeUnite.Id }, typeUnite)); }
public async Task <IActionResult> PuttypeUnite(int id, typeUnite typeUnite) { if (id != typeUnite.Id) { return(BadRequest()); } _context.Entry(typeUnite).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!typeUniteExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }