Esempio n. 1
0
        public async Task <ActionResult <PhotoForPersonDto> > AddPhotoForPerson(int personId, [FromForm] IFormFile file)
        {
            var photo = await _repository.AddPhotoForPersonAsync(personId, file);

            if (photo != null)
            {
                await _repository.CommitAsync();
            }

            return(CreatedAtAction(nameof(GetPhoto), new { photoId = photo.PhotoId }, photo.Adapt <PhotoForPersonDto>()));
        }