public async Task <ActionResult <DProductStock> > PostDProductStock(DProductStock dProductStock) { _context.DProductStocks.Add(dProductStock); await _context.SaveChangesAsync(); return(CreatedAtAction("GetDProductStock", new { id = dProductStock.Id }, dProductStock)); }
public async Task <IActionResult> PutDProductStock(int id, DProductStock dProductStock) { if (id != dProductStock.Id) { return(BadRequest()); } _context.Entry(dProductStock).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!DProductStockExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }