Class StorageStore<TData, TSource>
A System.Collections.Generic.IEnumerable<T> that uses Azure Storage for storage.
Inheritance
Inherited Members
Namespace: Cqrs.Azure.BlobStorage
Assembly: Cqrs.Azure.BlobStorage.dll
Syntax
public abstract class StorageStore<TData, TSource> : IEnumerable<TData>, IEnumerable
Type Parameters
Name | Description |
---|---|
TData | |
TSource |
Constructors
StorageStore(ILogger)
Initializes a new instance of the StorageStore<TData, TSource> class using the specified container.
Declaration
protected StorageStore(ILogger logger)
Parameters
Type | Name | Description |
---|---|---|
cdmdotnet.Logging.ILogger | logger |
Properties
AzureStorageRetryPolicy
Gets the default retry policy dedicated to handling transient conditions with Windows Azure Storage.
Declaration
protected virtual RetryPolicy AzureStorageRetryPolicy { get; }
Property Value
Type | Description |
---|---|
Microsoft.Practices.TransientFaultHandling.RetryPolicy |
DefaultSettings
The default Newtonsoft.Json.JsonSerializerSettings to use.
Declaration
public static JsonSerializerSettings DefaultSettings { get; }
Property Value
Type | Description |
---|---|
Newtonsoft.Json.JsonSerializerSettings |
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 abstract 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. |
Expression
Gets the expression tree that is associated with the instance of System.Linq.IQueryable.
Declaration
public abstract 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. |
GetContainerName
Gets or sets the System.Func<TResult> that returns the name of the container.
Declaration
protected Func<string> GetContainerName { get; set; }
Property Value
Type | Description |
---|---|
System.Func<System.String> |
IsContainerPublic
Gets or sets the System.Func<TResult> that returns if the container is public or not.
Declaration
protected Func<bool> IsContainerPublic { get; set; }
Property Value
Type | Description |
---|---|
System.Func<System.Boolean> |
Logger
Gets the cdmdotnet.Logging.ILogger.
Declaration
protected ILogger Logger { get; }
Property Value
Type | Description |
---|---|
cdmdotnet.Logging.ILogger |
Provider
Gets the query provider that is associated with this data source.
Declaration
public abstract IQueryProvider Provider { get; }
Property Value
Type | Description |
---|---|
System.Linq.IQueryProvider | The System.Linq.IQueryProvider that is associated with this data source. |
ReadableStorageAccount
Gets the readable Microsoft.WindowsAzure.Storage.CloudStorageAccount.
Declaration
protected CloudStorageAccount ReadableStorageAccount { get; }
Property Value
Type | Description |
---|---|
Microsoft.WindowsAzure.Storage.CloudStorageAccount |
WritableCollection
Gets the collection of writeable Microsoft.WindowsAzure.Storage.CloudStorageAccount.
Declaration
protected IList<Tuple<CloudStorageAccount, TSource>> WritableCollection { get; }
Property Value
Type | Description |
---|---|
System.Collections.Generic.IList<System.Tuple<Microsoft.WindowsAzure.Storage.CloudStorageAccount, TSource>> |
Methods
Add(TData)
Add the provided data
to the data store and persist the change.
Declaration
public abstract void Add(TData data)
Parameters
Type | Name | Description |
---|---|---|
TData | data |
Add(IEnumerable<TData>)
Add the provided data
to the data store and persist the change.
Declaration
public virtual void Add(IEnumerable<TData> data)
Parameters
Type | Name | Description |
---|---|---|
System.Collections.Generic.IEnumerable<TData> | data |
CreateSource(CloudStorageAccount, String, Boolean)
Creates a TSource
with the specified name sourceName
if it doesn't already exist.
Declaration
protected abstract TSource CreateSource(CloudStorageAccount storageAccount, string sourceName, bool isPublic = true)
Parameters
Type | Name | Description |
---|---|---|
Microsoft.WindowsAzure.Storage.CloudStorageAccount | storageAccount | The storage account to create the container is |
System.String | sourceName | The name of the source. |
System.Boolean | isPublic | Whether or not this source is publicly accessible. |
Returns
Type | Description |
---|---|
TSource |
Deserialise(Stream)
Deserialise the provided dataStream
from its System.IO.Stream representation.
Declaration
protected virtual TData Deserialise(Stream dataStream)
Parameters
Type | Name | Description |
---|---|---|
System.IO.Stream | dataStream | A System.IO.Stream representation of an |
Returns
Type | Description |
---|---|
TData |
Deserialise(String)
Deserialise the provided json
from its System.String representation.
Declaration
protected virtual TData Deserialise(string json)
Parameters
Type | Name | Description |
---|---|---|
System.String | json | A System.String representation of an |
Returns
Type | Description |
---|---|
TData |
Destroy(TData)
Remove the provided data
(normally by Rsn) from the data store and persist the change.
Declaration
public abstract void Destroy(TData data)
Parameters
Type | Name | Description |
---|---|---|
TData | data |
Dispose()
Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
Declaration
public void Dispose()
GetEnumerator()
Returns an enumerator that iterates through the collection.
Declaration
public abstract 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. |
Implements
GetSafeSourceName(String)
Gets the provided sourceName
in a safe to use in lower case format.
Declaration
protected virtual string GetSafeSourceName(string sourceName)
Parameters
Type | Name | Description |
---|---|---|
System.String | sourceName | The name to make safe. |
Returns
Type | Description |
---|---|
System.String |
GetSafeSourceName(String, Boolean)
Gets the provided sourceName
in a safe to use in format.
Declaration
protected virtual string GetSafeSourceName(string sourceName, bool lowerCaseName)
Parameters
Type | Name | Description |
---|---|---|
System.String | sourceName | The name to make safe. |
System.Boolean | lowerCaseName | Indicates if the generated name is forced into a lower case format. |
Returns
Type | Description |
---|---|
System.String |
GetSerialisationSettings()
Returns DefaultSettings
Declaration
protected virtual JsonSerializerSettings GetSerialisationSettings()
Returns
Type | Description |
---|---|
Newtonsoft.Json.JsonSerializerSettings | DefaultSettings |
GetSerialiser()
Creates a new Newtonsoft.Json.JsonSerializer using the settings from GetSerialisationSettings().
Declaration
protected virtual JsonSerializer GetSerialiser()
Returns
Type | Description |
---|---|
Newtonsoft.Json.JsonSerializer | A new instance of Newtonsoft.Json.JsonSerializer. |
Initialise(IStorageStoreConnectionStringFactory)
Initialises the StorageStore<TData, TSource>.
Declaration
protected virtual void Initialise(IStorageStoreConnectionStringFactory storageDataStoreConnectionStringFactory)
Parameters
Type | Name | Description |
---|---|---|
IStorageStoreConnectionStringFactory | storageDataStoreConnectionStringFactory |
RemoveAll()
Remove all contents (normally by use of a truncate operation) from the data store and persist the change.
Declaration
public abstract void RemoveAll()
Serialise(TData)
Serialise the provided data
.
Declaration
protected virtual Stream Serialise(TData data)
Parameters
Type | Name | Description |
---|---|---|
TData | data | The |
Returns
Type | Description |
---|---|
System.IO.Stream | A System.IO.Stream representation of the provided |
Update(TData)
Update the provided data
in the data store and persist the change.
Declaration
public abstract void Update(TData data)
Parameters
Type | Name | Description |
---|---|---|
TData | data |
Explicit Interface Implementations
IEnumerable.GetEnumerator()
Returns an enumerator that iterates through a collection.
Declaration
IEnumerator IEnumerable.GetEnumerator()
Returns
Type | Description |
---|---|
System.Collections.IEnumerator | An System.Collections.IEnumerator object that can be used to iterate through the collection. |