private async Task <CanvasAccountModel> ParentAccount() { if (_ParentAccount == null) { List <CanvasAccountModel> temp = await AccountList() as List <CanvasAccountModel>; if (temp != null && temp.Count > 0) { _ParentAccount = (from a in temp where a.parent_account_id == null select a).FirstOrDefault(); } } return(_ParentAccount); }
private async Task <int> ParentAccountId() { int iAccountId = 0; string sAccountId = System.Configuration.ConfigurationManager.AppSettings["CanvasAccountId"]; if (string.IsNullOrEmpty(sAccountId)) { CanvasAccountModel temp = await ParentAccount(); if (temp != null) { iAccountId = temp.id; } } else { iAccountId = (int)Convert.ChangeType(System.Configuration.ConfigurationManager.AppSettings["CanvasAccountId"], typeof(int)); } return(iAccountId); }