Skip to content
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.
C#
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
build
docs
samples/SampleConsole
src/TableStorage.UnsupportedTypes
tests/TableStorage.UnsupportedTypes.Tests
.editorconfig
.gitattributes
.gitignore
GitVersion.yml
LICENSE
README.md
UnsupportedTypes.sln
appveyor.yml
bootstrap.ps1
bootstrap.sh
build.cake
build.ps1

README.md

Azure Table storage Unsupported Types

Package Release Pre-release
TableStorage.UnsupportedTypes NuGet MyGet
CI Status Platform(s) Framework(s) Test Framework(s)
AppVeyor Build Status Windows nestandard2.0 netcoreapp2.2.2

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 from JSON 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.

How it works

  1. Your TableEntity should inherit from UnsupportedTypesTableEntity
  2. Decorate the properties you want to store with the UnsupportedTypeAttribute
  3. 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:

Output of the console

Console

Entity stored in storage

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

Initial setup on Windows

.\bootstrap.ps1

Initial setup on Linux / OS X

./bootstrap.sh

Run build script

dotnet cake build.cake
You can’t perform that action at this time.