asp.net - can some one help me with c# exception? -
i using hellosign c# api , when calling function account info using below code
var hellosign = new hellosignclient("username", "password"); account account = await hellosign.account.getasync(); console.writeline("your current callback: " + account.callbackurl); i getting below error.
error 2 'await' operator can used within async method. consider marking method 'async' modifier , changing return type 'task'. below getasync method
public async task<account> getasync() { accountwrapper accountwrapper = await hellosignservice.makerequestasync<accountwrapper>(settings.hellosignsettings.endpoints.account.get); return accountwrapper.account; } this type of account class
public class account : accountcondensedwithrole { [jsonproperty("callback_url")] public string callbackurl { get; internal set; } } can 1 tell me how call or how debug ???
you should wrap block in async method
public async task<type> methodasync(){ // other code if needed .... var hellosign = new hellosignclient("username", "password"); account account = await hellosign.account.getasync(); console.writeline("your current callback: " + account.callbackurl); return type; }
Comments
Post a Comment