public async Task <IActionResult> Putaccount_types([FromRoute] int id, [FromBody] account_types account_types) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } if (id != account_types.id) { return(BadRequest()); } _context.Entry(account_types).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!account_typesExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }
public async Task <IActionResult> Postaccount_types([FromBody] account_types account_types) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } _context.account_types.Add(account_types); await _context.SaveChangesAsync(); return(CreatedAtAction("Getaccount_types", new { id = account_types.id }, account_types)); }