visual studio 2013 - Restful service always returns null value in Xamarin Forms -
i developing app using "xamarin forms", , i'm using visual studio 2013 develop app. here problem is, in app i'm using restful services post/get data. entire code wrote in "xamarin shared project" here code:
using system.threading.tasks; using system.net.http; namespace sher.services { public class customerservice : icustomerservice { public async task<string> topentries(string uri) { var client = new httpclient(); var result = await client.getstringasync(uri); //"http://api.ihackernews.com/page" homecoming result; } } public interface icustomerservice { task<string> topentries(); } }
here i'm facing little problem. able phone call service method , service method execute in server. homecoming result gives "null". don't know why. can 1 help me solve problem. in advance.
yup, how async methods work. when async phone call (await keyword) made exit , go on point when async calls completed. seek putting breakpoint in "return result;" line.
visual-studio-2013 xamarin xamarin-studio xamarin.forms
No comments:
Post a Comment