public async Task <IActionResult> PutAsientocontable([FromRoute] int id, [FromBody] Asientocontable asientocontable) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } if (id != asientocontable.AsientoId) { return(BadRequest()); } _context.Entry(asientocontable).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!AsientocontableExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }
public async Task <IActionResult> PostAsientocontable([FromBody] Asientocontable asientocontable) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } _context.Asientocontable.Add(asientocontable); await _context.SaveChangesAsync(); return(CreatedAtAction("GetAsientocontable", new { id = asientocontable.AsientoId }, asientocontable)); }