public async Task <Bitmap> GetAsync(string image) { if (string.IsNullOrEmpty(image)) { return(await decorated.GetAsync(image)); } var bitmap = cache.Get(image) as Bitmap; if (bitmap != null) { return(await Task.Run(() => bitmap)); } bitmap = await decorated.GetAsync(image); if (bitmap != null) { cache.Put(image, bitmap); } return(bitmap); }
public Task <Bitmap> GetBitmapAsync(string image) { return(bitmapRepository.GetAsync(image)); }