I working on creating a Xamarin.Forms Android application that calls a web service.
Example Service Interface:
[ServiceContract]
public interface IService
{
[OperationContract]
Task<Result> method();
}
Example Service Class:
public class Service : IService
{
public async Task<Result>method()
{
var result = new Result();
result = await dataAccess();
return result;
}
}
The problem that I am having is that when I generate the service using SlSvcUtil.exe it creates **void **asynchronous methods with event handlers. Is there a way to create the service reference so that it returns **tasks ** instead of void?