C# Class GlobalDemo.DAL.Azure.StorageRepository

Afficher le fichier Open project: kaevans/globalscaledemo Class Usage Examples

Méthodes publiques

Méthode Description
GetBlob ( string containerName, string fileName ) : Task
GetBlobContainerSASToken ( ) : string

Gets the blob container's SAS token without any parameters. Defaults are Write permissions for 2 minutes

GetBlobContainerSASToken ( string containerName, SharedAccessBlobPermissions permissions, int minutes ) : string

Gets a blob container's SAS token

GetBlobURI ( string fileName, string containerName ) : Uri

Get a block blob's URI

GetLatestFromTableStorageAsync ( ) : Task>

This is a full table scan. Yuck.

GetPhotoFromTableAsync ( string tableName, string partitionKey, string rowKey ) : Task

This is the most efficient way to retrieve, using both the partition key and row key

GetPhotosFromTableAsync ( string tableName, string partitionKey ) : Task>

This is a partition scan. Less optimal, but not as bad as a full table scan.

MonitorCopy ( Microsoft.WindowsAzure.Storage.Blob.CloudBlobContainer destContainer, string fileName, TextWriter log ) : Task

Monitors a blob copy operation

ReplicateBlobAsync ( string targetConnectionString, string sourceContainerName, string targetContainerName, string blobName, TextWriter log ) : Task

Replicates a blob from the current storage account to a target storage account

SaveToTableStorageAsync ( string tableName, PhotoModel model ) : Task

Saves an entity to Azure table storage

SendBroadcastQueueMessageAsync ( string data ) : Task

Sends a queue message

SendQueueMessageAsync ( string data ) : Task

Sends a queue message

StorageRepository ( Microsoft.WindowsAzure.Storage.CloudStorageAccount account ) : GlobalDemo.DAL.Models
StorageRepository ( string connectionString ) : GlobalDemo.DAL.Models
UploadBlobAsync ( MemoryStream stream, string containerName, string fileName ) : Task

Method Details

GetBlob() public méthode

public GetBlob ( string containerName, string fileName ) : Task
containerName string
fileName string
Résultat Task

GetBlobContainerSASToken() public méthode

Gets the blob container's SAS token without any parameters. Defaults are Write permissions for 2 minutes
public GetBlobContainerSASToken ( ) : string
Résultat string

GetBlobContainerSASToken() public méthode

Gets a blob container's SAS token
public GetBlobContainerSASToken ( string containerName, SharedAccessBlobPermissions permissions, int minutes ) : string
containerName string The container name
permissions SharedAccessBlobPermissions The permissions
minutes int Number of minutes the permissions are effective
Résultat string

GetBlobURI() public méthode

Get a block blob's URI
public GetBlobURI ( string fileName, string containerName ) : Uri
fileName string The file name in storage
containerName string The container name
Résultat System.Uri

GetLatestFromTableStorageAsync() public méthode

This is a full table scan. Yuck.
public GetLatestFromTableStorageAsync ( ) : Task>
Résultat Task>

GetPhotoFromTableAsync() public méthode

This is the most efficient way to retrieve, using both the partition key and row key
public GetPhotoFromTableAsync ( string tableName, string partitionKey, string rowKey ) : Task
tableName string
partitionKey string
rowKey string
Résultat Task

GetPhotosFromTableAsync() public méthode

This is a partition scan. Less optimal, but not as bad as a full table scan.
public GetPhotosFromTableAsync ( string tableName, string partitionKey ) : Task>
tableName string
partitionKey string
Résultat Task>

MonitorCopy() public méthode

Monitors a blob copy operation
public MonitorCopy ( Microsoft.WindowsAzure.Storage.Blob.CloudBlobContainer destContainer, string fileName, TextWriter log ) : Task
destContainer Microsoft.WindowsAzure.Storage.Blob.CloudBlobContainer The destination container to monitor
fileName string
log System.IO.TextWriter The log to write output
Résultat Task

ReplicateBlobAsync() public méthode

Replicates a blob from the current storage account to a target storage account
public ReplicateBlobAsync ( string targetConnectionString, string sourceContainerName, string targetContainerName, string blobName, TextWriter log ) : Task
targetConnectionString string Connection string of the target storage account
sourceContainerName string The source container
targetContainerName string The target container
blobName string The blob to replicate
log System.IO.TextWriter TextWriter used for logging
Résultat Task

SaveToTableStorageAsync() public méthode

Saves an entity to Azure table storage
public SaveToTableStorageAsync ( string tableName, PhotoModel model ) : Task
tableName string The name of the table to save to
model GlobalDemo.DAL.Models.PhotoModel The PhotoModel object to be saved
Résultat Task

SendBroadcastQueueMessageAsync() public méthode

Sends a queue message
public SendBroadcastQueueMessageAsync ( string data ) : Task
data string The message to send
Résultat Task

SendQueueMessageAsync() public méthode

Sends a queue message
public SendQueueMessageAsync ( string data ) : Task
data string The message to send
Résultat Task

StorageRepository() public méthode

public StorageRepository ( Microsoft.WindowsAzure.Storage.CloudStorageAccount account ) : GlobalDemo.DAL.Models
account Microsoft.WindowsAzure.Storage.CloudStorageAccount
Résultat GlobalDemo.DAL.Models

StorageRepository() public méthode

public StorageRepository ( string connectionString ) : GlobalDemo.DAL.Models
connectionString string
Résultat GlobalDemo.DAL.Models

UploadBlobAsync() public méthode

public UploadBlobAsync ( MemoryStream stream, string containerName, string fileName ) : Task
stream System.IO.MemoryStream
containerName string
fileName string
Résultat Task