Azure Table Storage に保存する "Comment" という型があります。コメントはその他の任意の数の型に関するものになる可能性があるため、これらすべての型が実装するインターフェイスを作成し、ICommentable 型のプロパティをコメントに配置しました。したがって、Comment には ICommentable 型の About というプロパティがあります。
コメントを Azure テーブル ストレージに保存しようとすると、Comment.About プロパティに値が含まれていると、価値のない無効な入力エラーが発生します。ただし、Comment.About に値がなければ問題ありません。これはなぜでしょうか?
参照型のプロパティは Comment.About だけではありません。たとえば、Comment.From は参照型ですが、Comment.About はインターフェイスである型の唯一のプロパティです。
失敗:
var comment = new Comment();
comment.CommentText = "It fails!";
comment.PartitionKey = "TEST";
comment.RowKey = "TEST123";
comment.About = sow1;
comment.From = person1;
作品:
var comment = new Comment();
comment.CommentText = "It works!";
comment.PartitionKey = "TEST";
comment.RowKey = "TEST123";
//comment.About = sow1;
comment.From = person1;
ありがとう!