コード例 #1
0
ファイル: SpotsService.cs プロジェクト: Emiliano-Barboza/da2
        public async Task <string> UploadImageAsync(int id, FileModel fileModel)
        {
            string url  = null;
            var    spot = await repository.GetSpotByIdAsync(id);

            if (spot == null)
            {
                throw new KeyNotFoundException();
            }

            url = await storageService.AddSpotImageAsync(id, fileModel);

            await repository.AddSpotImageAsync(id, url);

            return(url);
        }