如何使AsyncCompletedEventArgs可序列化

时间:2016-01-22 20:17:18

标签: c# wcf serialization httprequest httpresponse

是否有解决方法使AsyncCompletedEventArgs类可序列化?

以下是我正在尝试做的一个例子:

我的服务参考包含:FooCompletedEventArgs receivedObject

然后:

public JsonResult Foo(FooCompletedEventArgs fooObject)
{
    return new JsonResult() { Data = fooObject, MaxJsonLength = int.MaxValue };
}

另一方面我做了:

public void FooFoo(FooCompletedEventArgs receivedFooObject)
{
    FooCompletedEventArgs model = JsonConvert.DeserializeObject<FooCompletedEventArgs>(e);
}

当我想反序列化时它失败了。

我检查了生成的服务引用,我注意到所有属性只有get函数没有设置。

0 个答案:

没有答案
相关问题