public async Task <ActionResult <LinhasDeFatura> > PostLinhasDeFatura(LinhasDeFatura linhasDeFatura) { _context.LinhasDeFaturas.Add(linhasDeFatura); await _context.SaveChangesAsync(); return(CreatedAtAction("GetLinhasDeFatura", new { id = linhasDeFatura.LinhasDeFaturaId }, linhasDeFatura)); }
public async Task <IActionResult> PutLinhasDeFatura(int id, LinhasDeFatura linhasDeFatura) { if (id != linhasDeFatura.LinhasDeFaturaId) { return(BadRequest()); } _context.Entry(linhasDeFatura).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!LinhasDeFaturaExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }