I'm trying to implement the following into my silverlight wcf ria services project.
http://blogs.msdn.com/b/kylemc/archive/2010/11/02/using-the-visual-studio-async-ctp-with-ria-services.aspx
It is working fine for entities. However I'm trying to write a custom method that returns a string and throws an error.
Custom metho开发者_Python百科d
public string GetHello(string str)
{
return ("Hello " + str);
}
Calling from Client
String str;
str = await context.LoadAsync(context.GetHello("Sam")).ToString();
Error:
The 'await' operator requires that its operand 'System.ServiceModel.DomainServices.Client.InvokeOperation' have a suitable public GetAwaiter method
You need to call AsTask
to convert the InvokeOperation
to a Task
.
精彩评论