GoatFam.AzureTableStorage
1.0.0
dotnet add package GoatFam.AzureTableStorage --version 1.0.0
NuGet\Install-Package GoatFam.AzureTableStorage -Version 1.0.0
<PackageReference Include="GoatFam.AzureTableStorage" Version="1.0.0" />
<PackageVersion Include="GoatFam.AzureTableStorage" Version="1.0.0" />
<PackageReference Include="GoatFam.AzureTableStorage" />
paket add GoatFam.AzureTableStorage --version 1.0.0
#r "nuget: GoatFam.AzureTableStorage, 1.0.0"
#:package GoatFam.AzureTableStorage@1.0.0
#addin nuget:?package=GoatFam.AzureTableStorage&version=1.0.0
#tool nuget:?package=GoatFam.AzureTableStorage&version=1.0.0
AzureTableStorage
A .NET Standard 2.1 library that wraps Azure Table Storage operations with a simple, type-safe interface.
Features
- Insert or update entities (upsert operations) - Add new entities or update existing ones in a single operation with automatic conflict resolution
- Get single entities by partition key and row key - Efficiently retrieve individual entities with strongly-typed results
- Query entities with LINQ expressions - Use familiar LINQ syntax to filter and query table data with compile-time type safety
- Delete entities - Remove entities from tables with ETag-based concurrency control
- Batch operations for adding multiple entities - Perform multiple insert/update operations in a single transaction for improved performance
- Retrieve all entities with optional filtering - Fetch complete datasets with support for custom filter expressions
Getting Started
Prerequisites
- .NET Standard 2.1 compatible runtime (.NET Core 3.1+, .NET 5+, .NET 6+, .NET 8+)
- Azure subscription with a Storage Account
- Azure.Identity library for managed identity support (optional)
Installation
Install the NuGet package in your project:
dotnet add package AzureTableStorage
Or add it via Package Manager:
Install-Package AzureTableStorage
For local development, reference the project directly:
<ProjectReference Include="..\..\src\AzureTableStorage\AzureTableStorage.csproj" />
Configuration
Add Azure Table Storage configuration to your appsettings.json:
{
"AzureTableStorage": {
"ConnectionString": "your-connection-string",
"StorageUri": "https://yourstorageaccount.table.core.windows.net/",
"ClientId": "your-managed-identity-client-id",
"TableName": "your-default-table"
}
}
Registration
Register the service in your Program.cs or Startup.cs:
using AzureTableStorage.Extensions;
// Register with default configuration
builder.Services.AddAzureTableStorage();
Basic Usage
Create a strongly-typed service by inheriting from TableStorageServiceBase<T>:
using AzureTableStorage.Services;
using Azure.Data.Tables;
// Define your entity
public class Article : ITableEntity
{
public string PartitionKey { get; set; }
public string RowKey { get; set; }
public DateTimeOffset? Timestamp { get; set; }
public ETag ETag { get; set; }
public string Title { get; set; }
public string Content { get; set; }
public string Author { get; set; }
}
// Create a service for your entity type
public class ArticleService : TableStorageServiceBase<Article>
{
public ArticleService(
IOptions<TableStorageOption> options,
IAzureClientFactory<TableServiceClient> factory)
: base(options, factory)
{
}
public async Task<Article> GetArticleByIdAsync(string category, string id)
{
return await GetAsync(category, id);
}
public async Task<List<Article>> GetArticlesByCategoryAsync(string category)
{
return await QueryAsync(a => a.PartitionKey == category);
}
}
// Register your service
builder.Services.AddScoped<ArticleService>();
// Use in your application
public class MyController
{
private readonly ArticleService _articleService;
public MyController(ArticleService articleService)
{
_articleService = articleService;
}
public async Task<Article> GetArticle(string category, string id)
{
return await _articleService.GetArticleByIdAsync(category, id);
}
}
Key Operations
// Insert or update an entity
await _articleService.AddOrUpdateAsync(article);
// Get a single entity
var article = await _articleService.GetAsync("Technology", "article-123");
// Query with LINQ
var articles = await _articleService.QueryAsync(a =>
a.PartitionKey == "Technology" && a.Author == "John Doe");
// Delete an entity
await _articleService.DeleteAsync("Technology", "article-123");
// Batch add multiple entities
await _articleService.AddBatchAsync(articlesList);
// Get all entities in a table
var allArticles = await _articleService.GetAllAsync();
Documentation
For detailed patterns and examples:
- docs/coding-patterns.md - Base class pattern and LINQ queries
- docs/sample-applications.md - Integration examples
- examples/ArticleManagementAPI - Working implementation with Article entities
License
This project is licensed under the MIT License.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net5.0 was computed. net5.0-windows was computed. net6.0 was computed. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 was computed. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 was computed. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. net9.0 was computed. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 is compatible. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
| .NET Core | netcoreapp3.0 was computed. netcoreapp3.1 was computed. |
| .NET Standard | netstandard2.1 is compatible. |
| MonoAndroid | monoandroid was computed. |
| MonoMac | monomac was computed. |
| MonoTouch | monotouch was computed. |
| Tizen | tizen60 was computed. |
| Xamarin.iOS | xamarinios was computed. |
| Xamarin.Mac | xamarinmac was computed. |
| Xamarin.TVOS | xamarintvos was computed. |
| Xamarin.WatchOS | xamarinwatchos was computed. |
-
.NETStandard 2.1
- Azure.Data.Tables (>= 12.8.2)
- Microsoft.Extensions.Azure (>= 1.7.1)
- Microsoft.Extensions.DependencyInjection (>= 8.0.0)
- Microsoft.Extensions.DependencyInjection.Abstractions (>= 8.0.0)
-
net10.0
- Azure.Data.Tables (>= 12.8.2)
- Microsoft.Extensions.Azure (>= 1.7.1)
- Microsoft.Extensions.DependencyInjection (>= 8.0.0)
- Microsoft.Extensions.DependencyInjection.Abstractions (>= 8.0.0)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 1.0.0 | 117 | 5/24/2026 |