public async Task <IActionResult> PutMapProductImages([FromRoute] int id, [FromBody] MapProductImages mapProductImages) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } if (id != mapProductImages.ImageId) { return(BadRequest()); } _context.Entry(mapProductImages).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!MapProductImagesExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }
public async Task <IActionResult> PostMapProductImages([FromBody] MapProductImages mapProductImages) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } _context.MapProductImages.Add(mapProductImages); await _context.SaveChangesAsync(); return(CreatedAtAction("GetMapProductImages", new { id = mapProductImages.ImageId }, mapProductImages)); }