Beispiel #1
0
        public async Task <ActionResult <PhotoForEmployeeDto> > AddPhotoForEmployee(int employeeId, [FromForm] IFormFile file)
        {
            var photo = await _repository.AddPhotoForEmployeeAsync(employeeId, file);

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

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