How to embed documents in Azure Table Storage

I'd like to be able to store objects that have child objects in Azure Table storage using a structure like so:

public class AzureTestDocument : TableServiceEntity
{
    public AzureTestDocument(int counter)
        : base("_default", counter.ToString())
    {
        Counter = counter;
        Child = new AzureTestChildDocument(counter);
    }

    public int Counter { get; set; }
}

public class AzureTestChildDocument
{
    public AzureTestChildDocument(int counter)
    {
        Counter = counter;
    }

    public int Counter { get; set; }
}

Saving the parent document if I remove the child document works fine. Saving a structure like this results in a "One of the request inputs is not valid" exception. Doing a little googling turned up this article about supported types which may mean you can't embed any types other than that short list of supported ones.

Please clarify if this is the case or point me towards what I may be missing.

Answers


Azure Table Storage supports saving of entities that only contain primitive properties. Any nested child objects need to be saved separately:

You can serialize the child objects into strings and save those strings as properties.

Alternatively, you can save those child objects as individual rows in Azure tables

Alternatively, if you're dealing with documents, you can save those objects in Azure BLOB storage.


Need Your Help

Dynamically display data from (design-time unknown) SQLite db to a table view

cocoa sqlite core-data nstableview cocoa-bindings

I'm trying to have a Table View displaying the content of a generic SQLite table.

Paypal Checkout issue

paypal oscommerce paypal-sandbox

I sell digital products using Paypal website payment standard. Everything is ok except that paypal checkout does not proceed stating the following error:

About UNIX Resources Network

Original, collect and organize Developers related documents, information and materials, contains jQuery, Html, CSS, MySQL, .NET, ASP.NET, SQL, objective-c, iPhone, Ruby on Rails, C, SQL Server, Ruby, Arrays, Regex, ASP.NET MVC, WPF, XML, Ajax, DataBase, and so on.