public async Task <ActionResult <type_acc> > Posttype_acc(type_acc type_acc) { _context.type_acc.Add(type_acc); await _context.SaveChangesAsync(); return(CreatedAtAction("Gettype_acc", new { id = type_acc.id_type_acc }, type_acc)); }
public async Task <IActionResult> Puttype_acc(int id, type_acc type_acc) { if (id != type_acc.id_type_acc) { return(BadRequest()); } _context.Entry(type_acc).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!type_accExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }