Hsp.Azure.Table.Orm 1.0.4

dotnet add package Hsp.Azure.Table.Orm --version 1.0.4
NuGet\Install-Package Hsp.Azure.Table.Orm -Version 1.0.4
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="Hsp.Azure.Table.Orm" Version="1.0.4" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add Hsp.Azure.Table.Orm --version 1.0.4
#r "nuget: Hsp.Azure.Table.Orm, 1.0.4"
#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 Hsp.Azure.Table.Orm as a Cake Addin
#addin nuget:?package=Hsp.Azure.Table.Orm&version=1.0.4

// Install Hsp.Azure.Table.Orm as a Cake Tool
#tool nuget:?package=Hsp.Azure.Table.Orm&version=1.0.4

A simple ORM (Object-Relational Mapper) for Azure Table Storage

Getting started

  • Create a class for each table you want to use. Your class does not need to descend from a specific base class.
  • Decorate the properties you want to use as fields in your table with one of the following attributes:
    • [Partitionkey]: Denotes the property to use as the tables PartitionKey. This is required. Almost. There are cases where that's not true. See below.
    • [RowKey]: Denotes the property to use as the tables RowKey. This is required.
    • [Field]: "normal" table fields. You can specify a different name that the field should have on the storage. If you don't, the property name is used as the field name.
  • Register your class through TableMetadata.Register<T>(string name) and make it known to the library. name specifies the table name on the storage.
  • The Register method allows you to also specify a 'fixed partition key' for the table. This is helpful if you have a table with only a few records and only one key property. If you use a 'fixed partition key', then you do not need to provide your class with [PartitionKey] attribute, because it's partition key is implicit.

Usage

Consider this class:

public class BassGuitar
{
    [RowKey] public string Name { get; set;}
    [PartitionKey] public string Manufacturer { get; set;}
    [Field] public int NoOfStrings { get; set;}
}

TableMetadata.Register<BassGuitar>("basses");

You can then insert a new record like so:

var sr1005 = new BassGuitar() {
    Name = "SR 5006OL",
    Manufacturer = "Ibanez",
    NoOfStrings = 6
}
await Record.Open<BassGuitar>()
    .Store(sr1005);

And you can query it like so:

var items = await Record.Open<BassGuitar>()
    // set a filter for manufacturer = 'Ibanez'
    .SetRange(a => a.Manufacturer, "Ibanez) 
    // set a filter for at least 5 strings
    .SetRange(a => a.NoOfStrings, 5, QueryComparisons.GreaterThanOrEqual)
    .Read();
Product Compatible and additional computed target framework versions.
.NET net6.0 is compatible.  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. 
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.4 141 7/4/2023
1.0.3 137 7/1/2023
1.0.2 109 6/30/2023
1.0.0 159 2/12/2023