Ronhaland.TableWorm
0.3.0-alpha2
This is a prerelease version of Ronhaland.TableWorm.
There is a newer prerelease version of this package available.
See the version list below for details.
See the version list below for details.
dotnet add package Ronhaland.TableWorm --version 0.3.0-alpha2
NuGet\Install-Package Ronhaland.TableWorm -Version 0.3.0-alpha2
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="Ronhaland.TableWorm" Version="0.3.0-alpha2" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Ronhaland.TableWorm" Version="0.3.0-alpha2" />
<PackageReference Include="Ronhaland.TableWorm" />
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 Ronhaland.TableWorm --version 0.3.0-alpha2
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: Ronhaland.TableWorm, 0.3.0-alpha2"
#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 Ronhaland.TableWorm@0.3.0-alpha2
#: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=Ronhaland.TableWorm&version=0.3.0-alpha2&prerelease
#tool nuget:?package=Ronhaland.TableWorm&version=0.3.0-alpha2&prerelease
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
TableContext
Library for interacting with azure storage account tables in a relational way.
Setup: Direct
var tableStorage = new TableStorage();
tableStorage
.ConfigureConnectionString("Connstr") // or .ConfigureTokenCredential()
.RegisterTable<Root>() // Register all Models
.RegisterTable<Base>()
.RegisterTable<Trunk>()
.RegisterTable<Branch>()
.RegisterTable<Leaf>();
Register DI Service
services.AddTableStorage(c =>
c.ConfigureConnectionString("Connstr")
.AddTable<Root>()
.AddTable<Base>()
.AddTable<Trunk>()
.AddTable<Branch>()
.AddTable<Leaf>());
Models must inherit from the TableModel class.
- The
TableForeignKeyAttribute is used to genererate a foreignkey field when saving and reading the table. - The
TableComboKeyAttribute makes the child-object's partitionkey a combination of this objects partitionKey and Id (RowKey). - The
TableIgnoreAttribute is used to ignore a property when saving and reading from the table. - The
TableParentAttribute tries to set the property to the parent of this object. - The
TableJsonAttribute is used to serialize/deserialize the value as json when reading and writing to the table.
Example:
public class Root : TableModel
{
[TableForeignKey("MyCustomBaseId")]
public required Base Base { get; set; }
public double SomeNumber { get; set; }
public DateTimeOffset CreatedAt { get; set; } = DateTimeOffset.UtcNow;
[TableIgnore]
public List<Branch> Branches { get; set; } = [];
}
public class Base : TableModel
{
[TableComboKey]
public List<Branch> Branches { get; set; } = [];
[TableParent]
public Root? Root { get; set; }
}
public class Branch : TableModel
{
[TableParent]
public Base? Base { get; set; }
}
To save/query/delete:
var allTrees = await tableStorage.QueryAsync<Root>(""); //Returns IEnumerable
var myTree = await tableStorage.QueryAsync<Root>("RowKey eq 'myTree'"); //Returns IEnumerable
await tableStorage.Save(newTree);
await tableStorage.Save(manyNewTrees); //Array
await tableStorage.Delete(badTree);
await tableStorage.Delete(allBadTrees); //Array
| Product | Versions 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 is compatible. 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.
-
net8.0
- Azure.Data.Tables (>= 12.8.3)
- Microsoft.Extensions.DependencyInjection.Abstractions (>= 8.0.1)
-
net9.0
- Azure.Data.Tables (>= 12.8.3)
- Microsoft.Extensions.DependencyInjection.Abstractions (>= 8.0.1)
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.3.1-alpha1 | 148 | 8/14/2025 |
| 0.3.0-alpha2 | 401 | 7/25/2025 |
| 0.3.0-alpha1 | 473 | 7/24/2025 |
| 0.2.0-alpha1 | 99 | 7/12/2024 |