コード例 #1
0
        public async Task <ActionResult> AddPhoto([FromForm] FormFileApiHelper photo, [FromQuery] Guid id)
        {
            var photoFile = photo.file;

            if (photoFile is null)
            {
                return(BadRequest());
            }

            return(await _products
                   .AddProductPhotoAsync(photoFile.OpenReadStream(), id, photoFile.FileName)
                   .ToActionResult());
        }