public async Task <IActionResult> PutDetallesfactura([FromRoute] int id, [FromBody] Detallesfactura detallesfactura) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } if (id != detallesfactura.DetalleId) { return(BadRequest()); } _context.Entry(detallesfactura).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!DetallesfacturaExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }
public async Task <IActionResult> PostDetallesfactura([FromBody] Detallesfactura detallesfactura) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } _context.Detallesfactura.Add(detallesfactura); await _context.SaveChangesAsync(); return(CreatedAtAction("GetDetallesfactura", new { id = detallesfactura.DetalleId }, detallesfactura)); }