Last active
May 6, 2016 19:40
-
-
Save TimMurphy/b49ca253445d6915087e35a2b1fe573f to your computer and use it in GitHub Desktop.
Azure Table Storage
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// WIP | |
public interface IAzureStorageTable<TEntity> where TEntity : ITableEntity | |
{ | |
Task AddAsync(TEntity entity) | |
Task CreateIfNotExists() | |
Task DeleteAsync(TEntity entity) | |
Task UpdateAsync(TEntity entity) | |
Task<IEnumerable<TEntity>> GetAsync(string partitionKey) | |
Task<TEntity> GetAsync(string partitionKey, string rowKey) | |
Task<IEnumerable<TEntity>> FindAsync() | |
Task<IEnumerable<TEntity>> FindAsync(int rows, out string continuationKey) | |
} | |
public class AzureStorageTable<TEntity> : IAzureStorageTable<TEntity> where TEntity : ITableEntity | |
{ | |
private readonly string _connectionString; | |
private readonly string _tableName; | |
public AzureStorageTable(string connectionString, string tableName) | |
{ | |
_connectionString = connectionString; | |
_tableName = tableName | |
} | |
public Task AddAsync(TEntity entity) | |
{ | |
var table = GetTable(); | |
..... | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment