/// <summary> /// Query blob metadata /// </summary> /// <param name="appHandle">App handle</param> /// <param name="userHandle">User handle</param> /// <param name="blobHandle">Blob handle</param> /// <returns>Blob metadata entity</returns> public async Task <IBlobMetadataEntity> QueryBlobMetadata(string appHandle, string userHandle, string blobHandle) { CTStore store = await this.tableStoreManager.GetStore(ContainerIdentifier.Blobs); ObjectTable table = this.tableStoreManager.GetTable(ContainerIdentifier.Blobs, TableIdentifier.BlobsMetadata) as ObjectTable; string partitionKey = this.GetPartitionKey(appHandle, userHandle); BlobMetadataEntity blobMetadataEntity = await store.QueryObjectAsync <BlobMetadataEntity>(table, partitionKey, blobHandle); return(blobMetadataEntity); }
/// <summary> /// Insert blob metadata /// </summary> /// <param name="storageConsistencyMode">Storage consistency mode</param> /// <param name="appHandle">App handle</param> /// <param name="userHandle">User handle</param> /// <param name="blobHandle">Blob handle</param> /// <param name="length">Blob length</param> /// <param name="contentType">Content type</param> /// <param name="blobType">Blob type</param> /// <returns>Insert blob metadata task</returns> public async Task InsertBlobMetadata(StorageConsistencyMode storageConsistencyMode, string appHandle, string userHandle, string blobHandle, long length, string contentType, BlobType blobType) { BlobMetadataEntity blobMetadataEntity = new BlobMetadataEntity() { AppHandle = appHandle, UserHandle = userHandle, BlobHandle = blobHandle, Length = length, ContentType = contentType, BlobType = blobType }; CTStore store = await this.tableStoreManager.GetStore(ContainerIdentifier.Blobs); ObjectTable table = this.tableStoreManager.GetTable(ContainerIdentifier.Blobs, TableIdentifier.BlobsMetadata) as ObjectTable; string partitionKey = this.GetPartitionKey(appHandle, userHandle); Operation operation = Operation.Insert(table, partitionKey, blobHandle, blobMetadataEntity); await store.ExecuteOperationAsync(operation, storageConsistencyMode.ToConsistencyMode()); }