EntityTableService 0.1.0-preview-19.1
See the version list below for details.
dotnet add package EntityTableService --version 0.1.0-preview-19.1
NuGet\Install-Package EntityTableService -Version 0.1.0-preview-19.1
<PackageReference Include="EntityTableService" Version="0.1.0-preview-19.1" />
paket add EntityTableService --version 0.1.0-preview-19.1
#r "nuget: EntityTableService, 0.1.0-preview-19.1"
// Install EntityTableService as a Cake Addin #addin nuget:?package=EntityTableService&version=0.1.0-preview-19.1&prerelease // Install EntityTableService as a Cake Tool #tool nuget:?package=EntityTableService&version=0.1.0-preview-19.1&prerelease
EntityTableClient
EntityTableClient is a part of EntityStorageServices, an experimental set of tools to manage your entities in Azure Storage Cloud services. EntityTableClient is based on the official Azure storage SDK which help you to manage pure entities in Azure table storage.
This project is focused on entity abstraction and performance.
Features:
- Pure and strongly typed Entity: no explicit dependency with ITableEntity interface
- Custom indexes
- Indexable dynamics props linked to an Entity
- Custom metadatas per entity
- Lightweight and extensible query expression builder (no dependency with ITableEntity)
- Entity table observers
How it works?
EntityTableClient generate and manage entity projections to store custom indexes. Internally, it use Azure storage ETG feature (entity transaction group) to keep projections synchronized with the main entity.
Sample console
Test project
Remark: Azure emulator required by default
EntityTableClient configuration example
var entityClient = new EntityTableClient<PersonEntity>(
new EntityTableClientOptions(_options,
c =>
{
c.SetPartitionKey(p => p.AccountId);
c.SetPrimaryKey(p => p.PersonId);
c.AddIndex(p => p.Created);
c.AddIndex(p => p.LastName);
c.AddIndex(p => p.Enabled);
c.AddIndex(p => p.Distance);
c.AddIndex("_FirstLastName3Chars");
c.AddDynamicProp("_IsInFrance", p => (p.Address.State == "France"));
c.AddDynamicProp("_MoreThanOneAddress", p => (p.OtherAddress.Count > 1));
c.AddDynamicProp("_CreatedNext6Month", p => (p.Created > DateTimeOffset.UtcNow.AddMonths(-6)));
c.AddDynamicProp("_FirstLastName3Chars", p => p.LastName.ToLower().Substring(0, 3));
}
);
Usage example: Query the Azure storage with entityTableClient
//Query entities with configured primarykey
_ = await entityClient.GetByIdAsync(
person.AccountId,
person.PersonId);
//Query entities with any props
_ = await entityClient.GetAsync(
person.AccountId,
w => w.Where(p => p.LastName).Equal(person.LastName));
//Query entities by indexed prop
_ = await entityClient.GetByAsync(
person.AccountId,
p => p.LastName,
person.LastName);
//Query entities with dynamic prop
_ = await entityClient.GetAsync(
person.AccountId,
w => w.Where("_FirstLastName3Chars").Equal("arm"));
//Query entities by indexed dynamic prop
_ = await entityClient.GetByAsync(
person.AccountId,
"_FirstLastName3Chars", "arm");
Sample console projet (600K entities with standard storageV2 account storage)
Generate faked 1000 entities...Ok
Insert 1000 entities...in 2,3804459 seconds
====================================
1. Get By Id 0,048 seconds
2. Get By LastName 1,983 seconds
3. Get By LastName (indexed) 0,1 seconds
4. Get LastName start with 'arm' 2,044 seconds
5. Get by LastName start with 'arm' (indexed) 0,056 seconds
====================================
You should use a real azure table storage connection with more than 50K entities to have relevant results
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. |
.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
- Microsoft.Azure.Cosmos.Table (>= 1.0.7)
- System.Text.Json (>= 4.7.2)
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.1.1-beta.2 | 6,984 | 6/27/2021 | |
0.1.1-beta | 490 | 6/5/2021 | |
0.1.0-preview-23.1 | 255 | 5/31/2021 | |
0.1.0-preview-23 | 201 | 5/31/2021 | |
0.1.0-preview-22 | 184 | 5/24/2021 | |
0.1.0-preview-21.5 | 163 | 5/20/2021 | |
0.1.0-preview-20.1 | 204 | 2/6/2021 | |
0.1.0-preview-19.1 | 288 | 1/8/2021 |