/// <summary> /// Query image metadata /// </summary> /// <param name="appHandle">App handle</param> /// <param name="userHandle">User handle</param> /// <param name="blobHandle">Blob handle</param> /// <returns>Image metadata entity</returns> public async Task <IImageMetadataEntity> QueryImageMetadata(string appHandle, string userHandle, string blobHandle) { CTStore store = await this.tableStoreManager.GetStore(ContainerIdentifier.Images); ObjectTable table = this.tableStoreManager.GetTable(ContainerIdentifier.Images, TableIdentifier.ImagesMetadata) as ObjectTable; string partitionKey = this.GetPartitionKey(appHandle, userHandle); ImageMetadataEntity imageMetadataEntity = await store.QueryObjectAsync <ImageMetadataEntity>(table, partitionKey, blobHandle); return(imageMetadataEntity); }
/// <summary> /// Insert image 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">Image length</param> /// <param name="contentType">Content type</param> /// <param name="imageType">Image type</param> /// <param name="reviewStatus">Review status</param> /// <returns>Insert image metadata task</returns> public async Task InsertImageMetadata(StorageConsistencyMode storageConsistencyMode, string appHandle, string userHandle, string blobHandle, long length, string contentType, ImageType imageType, ReviewStatus reviewStatus) { ImageMetadataEntity imageMetadataEntity = new ImageMetadataEntity() { AppHandle = appHandle, UserHandle = userHandle, BlobHandle = blobHandle, Length = length, ContentType = contentType, ImageType = imageType, ReviewStatus = reviewStatus }; CTStore store = await this.tableStoreManager.GetStore(ContainerIdentifier.Images); ObjectTable table = this.tableStoreManager.GetTable(ContainerIdentifier.Images, TableIdentifier.ImagesMetadata) as ObjectTable; string partitionKey = this.GetPartitionKey(appHandle, userHandle); Operation operation = Operation.Insert(table, partitionKey, blobHandle, imageMetadataEntity); await store.ExecuteOperationAsync(operation, storageConsistencyMode.ToConsistencyMode()); }