public async Task <IActionResult> PutPrdOrders([FromRoute] int id, [FromBody] PrdOrders prdOrders) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } if (id != prdOrders.OrderId) { return(BadRequest()); } _context.Entry(prdOrders).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!PrdOrdersExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }
public async Task <IActionResult> PostPrdOrders([FromBody] PrdOrders prdOrders) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } _context.PrdOrders.Add(prdOrders); await _context.SaveChangesAsync(); return(CreatedAtAction("GetPrdOrders", new { id = prdOrders.OrderId }, prdOrders)); }