Azure Table Storage rejects an entity with a Property whose value is an Interface

Posted by Andrew B Schultz on Stack Overflow See other posts from Stack Overflow or by Andrew B Schultz
Published on 2012-10-05T21:26:37Z Indexed on 2012/10/09 15:38 UTC
Read the original article Hit count: 250

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!

© Stack Overflow or respective owner

Related posts about Azure

Related posts about windows-azure-storage