現在、WCF RIA ドメイン サービス クラスを使用して辞書オブジェクトのリストを生成しています。
[Invoke]
public IEnumerable<IDictionary> GenerateData()
{
List<IDictionary> newList = new List<IDictionary>();
for (var i = 0; i < 10; i++)
{
var dict = new Dictionary<string, object>();
dict["ID"] = Guid.NewGuid();
dict["Name"] = "Name_" + i;
dict["Index"] = i;
newList.Add(dict);
}
return newList;
}
このリストを Silverlight に渡したい:
DomainContext _myContext = new DomainContext();
InvokeOperation<IEnumerable<IDictionary>> loadop4 = this._myContext.GenerateData();
loadop4.Completed += new System.EventHandler(loadop4_callback);
void loadop4_callback(Object sender, System.EventArgs e)
{
InvokeOperation<IEnumerable<IDictionary>> iop = sender as InvokeOperation<IEnumerable<IDictionary>>;
//... do stuff with IOP
}
しかし、VS2010でこのエラーが発生しています:
Error 1 Operation named 'GenerateData' does not conform to the required signature. Return types must be an entity or complex type, a collection of entities or complex types, or one of the predefined serializable types.
これを修正するにはどうすればよいですか? 辞書のリストは Silverlight でサポートされていると思いました