Exemplo n.º 1
0
        public async Task <IActionResult> AddPhotoAsync(
            [FromRoute(Name = "eventId")] int eventId,
            [FromForm(Name = "image")] IFormFile file,
            [FromHeader(Name = "userId")] int userId)
        {
            if (file == null)
            {
                return(UnprocessableEntity());
            }
            var createdImage = await _photoService.AddEventPhotoAsync
                                   (eventId, file);

            return(Ok(createdImage));
        }