public Task PutThumbnailAsync(Guid id, byte[] buffer) { return(Task.Factory.StartNew(() => { lock (_lock) { var filename = _directoryProvider.GetThumbnailPath(id); Save(buffer, filename); } })); }
public byte[] GetThumbnail(Guid id) { var imageFilename = _directoryProvider.GetThumbnailPath(id); return(!File.Exists(imageFilename) ? null : ReadFile(imageFilename)); }