オブジェクトを予期し、リフレクションを使用してそのプロパティを取得するWCFサービスメソッドがあります。
クライアント側では、匿名型のオブジェクトを作成します
var obj = new {FirstName="John", LastName="Doe"}
それをメソッドに渡します。例外が発生します:
Type '<>f__AnonymousType0`2[System.String,System.String]' cannot be serialized.
Consider marking it with the DataContractAttribute attribute, and marking all
of its members you want serialized with the DataMemberAttribute attribute.
See the Microsoft .NET Framework documentation for other supported types.
明示的に宣言された型やプロパティが実際にはないため、型またはそのメンバーをシリアル化属性でマークすることはできません。その問題を克服する方法はありますか?