Skip to content

Instantly share code, notes, and snippets.

@chribben
Created October 7, 2012 10:09
Show Gist options
  • Save chribben/3847751 to your computer and use it in GitHub Desktop.
Save chribben/3847751 to your computer and use it in GitHub Desktop.
Async gotcha in C# III
async void ImageCaptured(Dto dto)
{
dto.Id = Guid.NewGuid().ToString();
var file = await _fileHndlr.CreateFileAsync(dto.Id);
dto.ImageFilePath = file.Path;
_fileOperator.StoreStream(dto.ImageStream, file);
SaveNewDataItem(dto);
var dataItem = dataSource.GetItem(dto.Id);
StoreData(dataItem);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment