示例#1
0
        public async Task <IActionResult> AddPhotoAsync(
            [FromForm(Name = "image")] IFormFile file,
            [FromHeader(Name = "userId")] int userId)
        {
            if (file == null)
            {
                return(UnprocessableEntity());
            }
            var createdImage = await _photoService
                               .AddUserPhotoAsync(userId, file);

            return(Ok(createdImage));
        }