public async Task <IActionResult> PutProductImage([FromRoute] int id, [FromBody] ProductImage productImage) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } if (id != productImage.Id) { return(BadRequest()); } _context.Entry(productImage).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!ProductImageExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }