Azure Table Storage rejects an entity with a property whose value is an interface

advertisements

I have a type called "Comment" that I'm saving to Azure Table Storage. Since a comment can be about any number of other types, I created an interface which all of these types implement, and then put a property of type ICommentable on the comment. So Comment has a property called About of type ICommentable.

When I try to save a Comment to Azure Table Storage, if the Comment.About property has a value, I get the worthless invalid input error. However, if there is no value for Comment.About, I have no problem. Why would this be?

Comment.About is not the only property that is a reference type. For example, Comment.From is a reference type, but the Comment.About is the only property of a type that is an interface.

Fails:

var comment = new Comment();
        comment.CommentText = "It fails!";
        comment.PartitionKey = "TEST";
        comment.RowKey = "TEST123";
        comment.About = sow1;
        comment.From = person1;

Works:

var comment = new Comment();
        comment.CommentText = "It works!";
        comment.PartitionKey = "TEST";
        comment.RowKey = "TEST123";
        //comment.About = sow1;
        comment.From = person1;

Thanks!


Windows Azure table storage can store only a handful of types, none of which are the ICommentable type you created: http://msdn.microsoft.com/en-us/library/windowsazure/dd179338.aspx.