gabrielweyer-pre-release - TableStorage.UnsupportedTypes 1.0.4-cake-local-tool0005
Allows to store unsupported data types in Azure Table storage.
PM> Install-Package TableStorage.UnsupportedTypes -Version 1.0.4-cake-local-tool0005 -Source https://www.myget.org/F/gabrielweyer-pre-release/api/v3/index.json
> nuget.exe install TableStorage.UnsupportedTypes -Version 1.0.4-cake-local-tool0005 -Source https://www.myget.org/F/gabrielweyer-pre-release/api/v3/index.json
> dotnet add package TableStorage.UnsupportedTypes --version 1.0.4-cake-local-tool0005 --source https://www.myget.org/F/gabrielweyer-pre-release/api/v3/index.json
<PackageReference Include="TableStorage.UnsupportedTypes" Version="1.0.4-cake-local-tool0005" />
Copy to clipboard
source https://www.myget.org/F/gabrielweyer-pre-release/api/v3/index.json
nuget TableStorage.UnsupportedTypes ~> 1.0.4-cake-local-tool0005
Copy to clipboard
> choco install TableStorage.UnsupportedTypes --version 1.0.4-cake-local-tool0005 --source https://www.myget.org/F/gabrielweyer-pre-release/api/v2
Import-Module PowerShellGet
Register-PSRepository -Name "gabrielweyer-pre-release" -SourceLocation "https://www.myget.org/F/gabrielweyer-pre-release/api/v2"
Install-Module -Name "TableStorage.UnsupportedTypes" -RequiredVersion "1.0.4-cake-local-tool0005" -Repository "gabrielweyer-pre-release" -AllowPreRelease
Copy to clipboard
Browse the sources in this package using Visual Studio or WinDbg by configuring the following legacy symbol server URL: https://www.myget.org/F/gabrielweyer-pre-release/symbols/
Azure Table storage Unsupported Types
Package | Release | Pre-release |
---|---|---|
TableStorage.UnsupportedTypes |
CI | Status | Platform(s) | Framework(s) | Test Framework(s) |
---|---|---|---|---|
AppVeyor | Windows |
nestandard2.0 |
netcoreapp3.1 |
Azure Table storage supports a limited set of data types (namely byte[]
, bool
, DateTime
, double
, Guid
, int
, long
and string
). Unsupported Types
allows to store unsupported data types with some limitations:
- Your
Type
should be serializable / deserializable to and fromJSON
using Json.NET - The entity should fit in
1 MB
This is distributed via a NuGet
package but the implementation is so simple that you can just copy the classes into your own solution if that works better for you.
:rotating_light: I'm using the legacy WindowsAzure.Storage NuGet
package, let me know if there is interest in using Microsoft.Azure.Cosmos.Table instead.
How it works
- Your
TableEntity
should inherit fromUnsupportedTypesTableEntity
- Decorate the properties you want to store with the
UnsupportedTypeAttribute
- That's all
public class Unimportant
{
public string FirstName { get; set; }
public string LastName { get; set; }
}
public class UnsupportedTypesTestTableEntity : UnsupportedTypesTableEntity
{
[UnsupportedType]
public Unimportant VeryImportant { get; set; }
}
There is a console application in src/SampleConsole demonstrating Unsupported Types
:
- You'll need the Azure storage emulator 5.5 or later
- Alternatively you can use a storage account and modify
AzureTableStorage:ConnectionString
accordingly inappsettings.json
- Alternatively you can use a storage account and modify
Output of the console
Entity stored in storage
Limitations
You will not be able to filter the entities using the unsupported types. You'll need to materialize them first and then use LINQ to Objects.
Potential improvements
Cache properties
Each read and write to Azure Table storage
will trigger the use of Reflection
. This could be improved by caching the unsupported properties, in this case the scan would happen once per application lifetime.
Running locally
Pre-requisites
- .NET Core SDK v3.1.300 and higher
Initial setup on Windows
.\bootstrap.ps1
Initial setup on Linux / OS X
./bootstrap.sh
Run build script
dotnet cake build.cake
- .NETStandard 2.0: 2.0.0.0
Assembly | Assembly hash | Match |
---|---|---|
/lib/netstandard2.0/tablestorage.unsupportedtypes.dll | 02eec89dd8a84b11b8ad8e075127b7edFFFFFFFF |
OwnersGabriel Weyer |
AuthorsGabriel Weyer |
Project URLhttps://github.com/gabrielweyer/unsupported-types |
LicenseUnknown |
TagsAzure Table storage |
Info4 total downloads |
1 downloads for version 1.0.4-cake-local-tool0005 |
Download (4.86 KB) |
Download legacy symbols (5.86 KB) |
Found on the current feed only |
Package history
Version | Size | Last updated | Downloads | Mirrored? | |||
---|---|---|---|---|---|---|---|
1.0.5-snupkg0001 | 4.83 KB | Sun, 31 May 2020 01:27:41 GMT | 0 | ||||
1.0.4-cake-local-tool0005 | 4.86 KB | Sun, 31 May 2020 00:52:28 GMT | 1 | ||||
1.0.4-cake-local-tool0004 | 4.86 KB | Sun, 31 May 2020 00:48:31 GMT | 1 | ||||
1.0.4-cake-local-tool0003 | 4.86 KB | Sun, 31 May 2020 00:32:35 GMT | 0 | ||||
1.0.3-dotnet-3-1-0001 | 4.85 KB | Sun, 29 Dec 2019 06:56:45 GMT | 1 | ||||
1.0.1-nuget-key0006 | 4.83 KB | Sat, 23 Feb 2019 00:49:07 GMT | 1 | ||||
0.1.4-dotnet-22-0003 | 4.85 KB | Thu, 03 Jan 2019 22:40:28 GMT | 0 | ||||
0.1.2-netcore2-1-0001 | 4.84 KB | Tue, 05 Jun 2018 12:43:05 GMT | 0 | ||||
0.1.0-initial-version0002 | 4.8 KB | Wed, 07 Feb 2018 20:54:35 GMT | 0 |