TGC.AzureTableStorage 0.1.1

There is a newer version of this package available.
See the version list below for details.
dotnet add package TGC.AzureTableStorage --version 0.1.1                
NuGet\Install-Package TGC.AzureTableStorage -Version 0.1.1                
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="TGC.AzureTableStorage" Version="0.1.1" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add TGC.AzureTableStorage --version 0.1.1                
#r "nuget: TGC.AzureTableStorage, 0.1.1"                
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install TGC.AzureTableStorage as a Cake Addin
#addin nuget:?package=TGC.AzureTableStorage&version=0.1.1

// Install TGC.AzureTableStorage as a Cake Tool
#tool nuget:?package=TGC.AzureTableStorage&version=0.1.1                

TGC.AzureTableStorage

Disclaimer: This library is still in alpha and is used on your own risk!

Using the library

Before doing anything code related, you'll need to configure your appsettings.

Create the following section (Ensure naming is correct):

"StorageConfiguration": {
	"AccountConnectionString": "DefaultEndpointsProtocol=https;AccountName={StorageAccountName};AccountKey={AccountKey};EndpointSuffix=core.windows.net"
}

In order to use the library you will need to add the following extension methods on your IServiceCollection:

builder.Services.AddAzureTableStorage();

The method above takes care of reading configuration values and setting up context.

The library maps classes to individual tables in the Azure Storage Account. For each table you will need to define a related DTO. The definition requires adding a custom attribute and inherit from a specific class.

An example looks like this:

namespace Your.Namespace;

[TableItem("FooBars")]
internal class FooBarItem : AzureTableItem
{
	public string Foo { get; set; }
	public string Bar { get; set; }
}

Once your DTO is defined, you will need to register a service for it. That is simply done the on your IServiceProvider as well with the following method:

builder.Services.AddStorageRepository<FooBarItem>();

Now, you can simply use the interface IAzureTableStorageRepository with any of your registered DTOs and your IServiceProvider takes care of the rest:

namespace Your.Namespace;

public class Service
{
	private readonly ILogger<Service> _logger;
	private readonly IAzureTableStorageRepository<FooBarItem> _azureTableStorageRepository;

	public Service(ILogger<Service> log, IAzureTableStorageRepository<FooBarItem> azureTableStorageRepository)
	{
		_logger = log;
		_azureTableStorageRepository = azureTableStorageRepository;
	}
}

Patch notes

0.0.3

First alpha-release

0.1.0

Upgraded to .Net 7 and updated readme

Product Compatible and additional computed target framework versions.
.NET net7.0 is compatible.  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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

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
0.4.0 124 4/6/2024
0.3.0 137 3/17/2024
0.2.1 164 7/16/2023
0.2.0 163 7/16/2023
0.1.6 145 6/18/2023
0.1.5 143 5/29/2023
0.1.4 134 5/29/2023
0.1.3 127 5/29/2023
0.1.2 143 5/28/2023
0.1.1 131 5/28/2023
0.1.0 129 5/28/2023
0.0.3 171 4/23/2023
0.0.2 166 4/23/2023
0.0.1 172 4/23/2023