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); }