Dewiride.Azure.Storage.Table.Helper 1.0.7

Prefix Reserved
dotnet add package Dewiride.Azure.Storage.Table.Helper --version 1.0.7
                    
NuGet\Install-Package Dewiride.Azure.Storage.Table.Helper -Version 1.0.7
                    
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="Dewiride.Azure.Storage.Table.Helper" Version="1.0.7" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Dewiride.Azure.Storage.Table.Helper" Version="1.0.7" />
                    
Directory.Packages.props
<PackageReference Include="Dewiride.Azure.Storage.Table.Helper" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add Dewiride.Azure.Storage.Table.Helper --version 1.0.7
                    
#r "nuget: Dewiride.Azure.Storage.Table.Helper, 1.0.7"
                    
#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.
#:package Dewiride.Azure.Storage.Table.Helper@1.0.7
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=Dewiride.Azure.Storage.Table.Helper&version=1.0.7
                    
Install as a Cake Addin
#tool nuget:?package=Dewiride.Azure.Storage.Table.Helper&version=1.0.7
                    
Install as a Cake Tool

Dewiride.Azure.Storage.Table.Helper

NuGet Version NuGet Downloads

Dewiride.Azure.Storage.Table.Helper is a .NET library that provides helper methods and an interface for interacting with Azure Table Storage.

Features

  • Retrieve single or multiple entities from Azure Table Storage.
  • Query entities by partition key, row key, or email.
  • Insert or merge entities into Azure Table Storage.
  • Delete entities from Azure Table Storage.
  • Easy-to-use asynchronous methods.

Installation

You can install the package via NuGet:

dotnet add package Dewiride.Azure.Storage.Table.Helper

Or via the NuGet Package Manager in Visual Studio.

Usage

Step 1: Configure Dependencies

Ensure you have the necessary NuGet packages installed:

  • Azure.Data.Tables
  • Microsoft.Extensions.Logging.Abstractions

Step 2: Create a TableServiceClient

First, create an instance of TableServiceClient and configure logging.

using Azure.Data.Tables;
using Microsoft.Extensions.Logging;
using Microsoft.Extensions.Logging.Abstractions;

var serviceClient = new TableServiceClient("<Your_Connection_String>");
var logger = NullLogger<TableStorageHelper>.Instance;

Step 3: Initialize the TableStorageHelper

Create an instance of TableStorageHelper using the TableServiceClient and ILogger.

using Azure.Storage.Table.Helper;

var tableStorageHelper = new TableStorageHelper(logger, serviceClient);

Initializing the TableStorageHelper from a DI container is recommended.

builder.Services.AddAzureClients(clientBuilder =>
            {
                clientBuilder.AddTableServiceClient(builder.Configuration["ConnectionString"] ?? throw new NullReferenceException("Table Storage not configured."));
            });

builder.Services.AddSingleton<ITableStorageHelper, TableStorageHelper>();

Usage in a service:

public class MyService
{
	private readonly ITableStorageHelper _tableStorageHelper;

	public MyService(ITableStorageHelper tableStorageHelper)
	{
		_tableStorageHelper = tableStorageHelper;
	}

	public async Task<MyEntity> GetEntityAsync(string partitionKey, string rowKey)
	{
		return await _tableStorageHelper.GetEntityAsync<MyEntity>("TableName", partitionKey, rowKey);
	}
}

Step 4: Use the Helper Methods

You can now use the helper methods to interact with Azure Table Storage.

Retrieve a Single Entity
var entity = await tableStorageHelper.GetEntityAsync<MyEntity>("TableName", "PartitionKey", "RowKey");
Retrieve Entities by Email
var entity = await tableStorageHelper.GetEntityByEmailAsync<MyEntity>("TableName", "PartitionKey", "email@example.com");
Retrieve All Entities by Partition Key
var entities = await tableStorageHelper.GetEntitiesAsync<MyEntity>("TableName", "PartitionKey");
Insert or Merge an Entity
var entity = new MyEntity
{
    PartitionKey = "PartitionKey",
    RowKey = "RowKey",
    Property = "Value"
};

var response = await tableStorageHelper.UpsertEntityAsync("TableName", entity);
Delete an Entity
var response = await tableStorageHelper.DeleteEntityAsync("TableName", "PartitionKey", "RowKey");

License

This project is licensed under the MIT License - see the LICENSE file for details.

Contributing

Contributions are welcome! Please open an issue or submit a pull request.

Contact

For more information or support, please contact Jagdish Kumawat at support@dewiride.com.

Acknowledgments

Product Compatible and additional computed target framework versions.
.NET net8.0 is compatible.  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 was computed.  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. 
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
1.0.7 108 1/29/2025
1.0.6 122 10/14/2024
1.0.5 126 7/22/2024
1.0.4 124 7/19/2024
1.0.3 125 6/28/2024
1.0.2 124 6/27/2024
1.0.1 147 6/27/2024 1.0.1 is deprecated because it is no longer maintained.
1.0.0 149 6/27/2024 1.0.0 is deprecated because it is no longer maintained.

Upgrade Package.