public async Task <ActionResult <tblCarProp> > PosttblCarProp(tblCarProp tblCarProp) { _context.tblCarProps.Add(tblCarProp); await _context.SaveChangesAsync(); return(CreatedAtAction("GettblCarProp", new { id = tblCarProp.IdCar }, tblCarProp)); }
public async Task <IActionResult> PuttblCarProp(int id, tblCarProp tblCarProp) { if (id != tblCarProp.IdCar) { return(BadRequest()); } _context.Entry(tblCarProp).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!tblCarPropExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }