public async Task <IActionResult> PutCuenta_Bancaria([FromRoute] int id, [FromBody] Cuenta_Bancaria cuenta_Bancaria) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } if (id != cuenta_Bancaria.Id) { return(BadRequest()); } _context.Entry(cuenta_Bancaria).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!Cuenta_BancariaExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }
public async Task <IActionResult> PostCuenta_Bancaria([FromBody] Cuenta_Bancaria cuenta_Bancaria) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } _context.Cuenta_Bancaria.Add(cuenta_Bancaria); await _context.SaveChangesAsync(); return(CreatedAtAction("GetCuenta_Bancaria", new { id = cuenta_Bancaria.Id }, cuenta_Bancaria)); }