Example #1
0
        private static bool TestClient(DataStorageType storageType)
        {
            var storageFactory = new StorageFactory<IImageSource>(new AutoFacIocContainer());

            var storage = storageFactory.Resolve(storageType);

            var data = File.ReadAllBytes(@"C:\Users\Public\Pictures\Sample Pictures\Koala.jpg");

            var imageSource = storage.Save(data, ".png", "Joshs Photos");

            var sourceData = storage.Retrieve(imageSource.Source);
            var thumbnailData = storage.Retrieve(imageSource.Thumbnail);

            File.WriteAllBytes(@"C:\temp\source.jpg", sourceData);
            File.WriteAllBytes(@"C:\temp\thumbnail.jpg", thumbnailData);

            return storage.Delete(imageSource.Source);
        }