Posts

Showing posts with the label Storage Table

Storage Table - Easy data access layer

You can simply use the below code structure when you want to write a data access layer for Azure Storage Table.  Use blow Interface as the skeleton of your data access class.       public interface ITableStorage<T>     {         Task<List<T>> GetAllAsync(string partitionKey);         Task<List<T>> RetrieveEntityAsync(string partitionKey, string rowPrefix);         Task<T> GetSingleAsync(T entity);         Task<T> GetSingleAsync(string partitionKey, string rowKey);         Task InsertEntityAsync(T entity, bool forInsert = true);         Task DeleteEntityAsync(T entity);         Task DeleteSingleAsync(string partitionKey, string rowKey);         Task<List<T>> RetrieveAsync(string partitionKey);     } Here is the generic concrete cl...