Class BlobStorageStore<TData>
A System.Collections.Generic.IEnumerable<T> that uses Azure Blobl Storage for storage.
Inheritance
Inherited Members
Namespace: Cqrs.Azure.BlobStorage
Assembly: Cqrs.Azure.BlobStorage.dll
Syntax
public class BlobStorageStore<TData> : StorageStore<TData, CloudBlobContainer>, IEnumerable<TData>, IEnumerable
Type Parameters
Name | Description |
---|---|
TData |
Constructors
BlobStorageStore(ILogger)
Initializes a new instance of the BlobStorageStore<TData> class using the specified container.
Declaration
public BlobStorageStore(ILogger logger)
Parameters
Type | Name | Description |
---|---|---|
cdmdotnet.Logging.ILogger | logger |
Properties
ElementType
Gets the type of the element(s) that are returned when the expression tree associated with this instance of System.Linq.IQueryable is executed.
Declaration
public override Type ElementType { get; }
Property Value
Type | Description |
---|---|
System.Type | A System.Type that represents the type of the element(s) that are returned when the expression tree associated with this object is executed. |
Overrides
Expression
Gets the expression tree that is associated with the instance of System.Linq.IQueryable.
Declaration
public override Expression Expression { get; }
Property Value
Type | Description |
---|---|
System.Linq.Expressions.Expression | The System.Linq.Expressions.Expression that is associated with this instance of System.Linq.IQueryable. |
Overrides
Provider
Gets the query provider that is associated with this data source.
Declaration
public override IQueryProvider Provider { get; }
Property Value
Type | Description |
---|---|
System.Linq.IQueryProvider | The System.Linq.IQueryProvider that is associated with this data source. |
Overrides
Methods
Add(TData)
Add the provided data
to the data store and persist the change.
Declaration
public override void Add(TData data)
Parameters
Type | Name | Description |
---|---|---|
TData | data |
Overrides
AsyncSaveData<TResult>(TData, Func<TData, CloudBlockBlob, TResult>, Func<TData, String>)
Save the provided data
asynchronously.
Declaration
protected virtual void AsyncSaveData<TResult>(TData data, Func<TData, CloudBlockBlob, TResult> function, Func<TData, string> customFilenameFunction = null)
Parameters
Type | Name | Description |
---|---|---|
TData | data | |
System.Func<TData, Microsoft.WindowsAzure.Storage.Blob.CloudBlockBlob, TResult> | function | |
System.Func<TData, System.String> | customFilenameFunction |
Type Parameters
Name | Description |
---|---|
TResult |
CreateSource(CloudStorageAccount, String, Boolean)
Creates a Microsoft.WindowsAzure.Storage.Blob.CloudBlobContainer with the specified name containerName
if it doesn't already exist.
Declaration
protected override CloudBlobContainer CreateSource(CloudStorageAccount storageAccount, string containerName, bool isPublic = true)
Parameters
Type | Name | Description |
---|---|---|
Microsoft.WindowsAzure.Storage.CloudStorageAccount | storageAccount | The storage account to create the Microsoft.WindowsAzure.Storage.Blob.CloudBlobContainer is |
System.String | containerName | The name of the Microsoft.WindowsAzure.Storage.Blob.CloudBlobContainer. |
System.Boolean | isPublic | Whether or not this Microsoft.WindowsAzure.Storage.Blob.CloudBlobContainer is publicly accessible. |
Returns
Type | Description |
---|---|
Microsoft.WindowsAzure.Storage.Blob.CloudBlobContainer |
Overrides
Destroy(TData)
Remove the provided data
(normally by Rsn) from the data store and persist the change.
Declaration
public override void Destroy(TData data)
Parameters
Type | Name | Description |
---|---|---|
TData | data |
Overrides
GetBlobReference(CloudBlobContainer, String)
Gets a reference to a block blob in the container.
Declaration
protected virtual CloudBlockBlob GetBlobReference(CloudBlobContainer container, string blobName)
Parameters
Type | Name | Description |
---|---|---|
Microsoft.WindowsAzure.Storage.Blob.CloudBlobContainer | container | The container to get the reference from |
System.String | blobName | The name of the blob. |
Returns
Type | Description |
---|---|
Microsoft.WindowsAzure.Storage.Blob.CloudBlockBlob | A reference to a block blob. |
GetByFolder(String)
Get all TData
items in the folder.
Declaration
public virtual IEnumerable<TData> GetByFolder(string folderName)
Parameters
Type | Name | Description |
---|---|---|
System.String | folderName |
Returns
Type | Description |
---|---|
System.Collections.Generic.IEnumerable<TData> |
GetByName(String)
Get TData
by its name.
Declaration
public virtual TData GetByName(string name)
Parameters
Type | Name | Description |
---|---|---|
System.String | name |
Returns
Type | Description |
---|---|
TData |
GetEnumerator()
Returns an enumerator that iterates through the collection.
Declaration
public override IEnumerator<TData> GetEnumerator()
Returns
Type | Description |
---|---|
System.Collections.Generic.IEnumerator<TData> | A System.Collections.Generic.IEnumerator<T> that can be used to iterate through the collection. |
Overrides
OpenStreamsForReading(Func<CloudBlockBlob, Boolean>, String, String)
Opens stream for reading from a block blob.
Declaration
protected virtual IEnumerable<Stream> OpenStreamsForReading(Func<CloudBlockBlob, bool> predicate = null, string blobPrefix = null, string folderName = null)
Parameters
Type | Name | Description |
---|---|---|
System.Func<Microsoft.WindowsAzure.Storage.Blob.CloudBlockBlob, System.Boolean> | predicate | |
System.String | blobPrefix | |
System.String | folderName |
Returns
Type | Description |
---|---|
System.Collections.Generic.IEnumerable<System.IO.Stream> |
RemoveAll()
Remove all contents (normally by use of a truncate operation) from the data store and persist the change.
Declaration
public override void RemoveAll()
Overrides
Update(TData)
Update the provided data
in the data store and persist the change.
Declaration
public override void Update(TData data)
Parameters
Type | Name | Description |
---|---|---|
TData | data |