public async Task <ActionResult <ProductTypePDF> > PostProductTypePDF(ProductTypePDF productTypePDF) { _context.productTypePDF.Add(productTypePDF); await _context.SaveChangesAsync(); return(CreatedAtAction("GetProductTypePDF", new { id = productTypePDF.ProductTypePDFId }, productTypePDF)); }
public async Task <IActionResult> PutProductTypePDF(int id, ProductTypePDF productTypePDF) { if (id != productTypePDF.ProductTypePDFId) { return(BadRequest()); } _context.Entry(productTypePDF).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!ProductTypePDFExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }