public async Task <IActionResult> AddImageForProduct( [FromBody] ProductImage productImage) { try { var createdProduct = await _repo.CreateProductImage(productImage); return(StatusCode(201)); // status for createdRoute } catch (Exception ex) { return(BadRequest(ex.Message)); } }
public ProductImage CreateProductImage(ProductImage productImage) { return(_productImageRepository.CreateProductImage(productImage)); }