public byte[] Find(string id)
 {
     using (var context = new BlobStorageDbContext(this.nameOrConnectionString))
     {
         return context.Find(id);
     }
 }
 public void Save(string id, string contentType, byte[] blob)
 {
     using (var context = new BlobStorageDbContext(this.nameOrConnectionString))
     {
         context.Save(id, contentType, blob);
     }
 }
Esempio n. 3
0
 public async Task Save(string id, string contentType, byte[] blob)
 {
     using (var context = new BlobStorageDbContext())
     {
         await context.Save(id, contentType, blob);
     }
 }
Esempio n. 4
0
 public async Task Delete(string id)
 {
     using (var context = new BlobStorageDbContext())
     {
         await context.Delete(id);
     }
 }
Esempio n. 5
0
 public async Task <byte[]> Find(string id)
 {
     using (var context = new BlobStorageDbContext())
     {
         return(await context.Find(id));
     }
 }
Esempio n. 6
0
 public void Delete(string id)
 {
     using (var context = new BlobStorageDbContext(this.nameOrConnectionString))
     {
         context.Delete(id);
     }
 }
Esempio n. 7
0
 public void Delete(string id)
 {
     using (var context = new BlobStorageDbContext(this.nameOrConnectionString))
     {
         context.Delete(id);
     }
 }
Esempio n. 8
0
 public void Save(string id, string contentType, byte[] blob)
 {
     using (var context = new BlobStorageDbContext(this.nameOrConnectionString))
     {
         context.Save(id, contentType, blob);
     }
 }
Esempio n. 9
0
 public byte[] Find(string id)
 {
     using (var context = new BlobStorageDbContext(this.nameOrConnectionString))
     {
         return(context.Find(id));
     }
 }
 public void Dispose()
 {
     using (var context = new BlobStorageDbContext(dbName))
     {
         if (context.Database.Exists())
         {
             context.Database.Delete();
         }
     }
 }
        public BlobStorageDbContextFixture()
        {
            using (var context = new BlobStorageDbContext(dbName))
            {
                if (context.Database.Exists())
                {
                    context.Database.Delete();
                }

                context.Database.Create();
            }
        }
        public void when_saving_blob_then_can_read_it()
        {
            using (var storage = new BlobStorageDbContext(this.dbName))
            {
                storage.Save("test", "text/plain", Encoding.UTF8.GetBytes("Hello"));
            }

            using (var storage = new BlobStorageDbContext(this.dbName))
            {
                var data = Encoding.UTF8.GetString(storage.Find("test"));

                Assert.Equal("Hello", data);
            }
        }