コード例 #1
0
        public async Task <Photo> PhotoUpload(Vehicle vehicle, IFormFile file, string uploadsFolderPath)
        {
            var fileName = await photoStorage.UploadPhoto(uploadsFolderPath, file);

            var photo = new Photo {
                FileName = fileName
            };

            // todo generate thumbnails
            vehicle.Photos.Add(photo);
            await unitOfWork.CompleteAsync();

            return(photo);
        }