예제 #1
0
 public Task PutThumbnailAsync(Guid id, byte[] buffer)
 {
     return(Task.Factory.StartNew(() =>
     {
         lock (_lock)
         {
             var filename = _directoryProvider.GetThumbnailPath(id);
             Save(buffer, filename);
         }
     }));
 }
예제 #2
0
        public byte[] GetThumbnail(Guid id)
        {
            var imageFilename = _directoryProvider.GetThumbnailPath(id);

            return(!File.Exists(imageFilename) ? null : ReadFile(imageFilename));
        }