public async Task <ActionResult <FacturaH> > PostFacturaH(FacturaH facturaH) { _context.FacturaH.Add(facturaH); await _context.SaveChangesAsync(); return(CreatedAtAction("GetFacturaH", new { id = facturaH.IdFacturaH }, facturaH)); }
public async Task <IActionResult> PutFacturaH(int id, FacturaH facturaH) { if (id != facturaH.IdFacturaH) { return(BadRequest()); } _context.Entry(facturaH).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!FacturaHExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }