1
votes

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!

2

2 Answers

2
votes

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.

1
votes

The Azure Table Storage Client does not support granular means of controlling which properties are persistable.

You may wish to check out my open source project on CodePlex which allows fine grain control over which fields/properties to persist to table storage and how to serialize them. (http://lucifurestash.codeplex.com/)

Edit: Fixed typo + clarifications.