public bool Delete(Account account)
 {
     IDictionary<string, object> vars = new Dictionary<string, object>(2);
     vars.Add("companyId", this.companyId);
     vars.Add("accountID", account.Id.Value);
     Account response = this.restTemplate.PostForObjectAsync<Account>("/resource/account/v2/{companyId}/{accountID}?methodx=delete", buildDelete(account), vars).Result;
     return (response.Id == null);
 }
        public AccountBuilder()
        {
            _account = new Account();

            _account.Name = "Loan Account";
            _account.Desc = "Loan Account";
            _account.Subtype = "Savings";
            _account.AcctNum = "5001";
        }
 public Task<Account> Save(Account account)
 {
     if (account.Id != null && account.Id.Value != null)
     {
         return Update(account);
     }
     else
     {
         return Create(account);
     }
 }
 private Account buildDelete(Account account)
 {
     Account delete = new Account();
     delete.SyncToken = account.SyncToken;
     delete.Id = account.Id;
     return delete;
 }
 public Task<Account> Update(Account account)
 {
     IDictionary<string, object> vars = new Dictionary<string, object>(2);
     vars.Add("companyId", this.companyId);
     vars.Add("accountID", account.Id.Value);
     return this.restTemplate.PostForObjectAsync<Account>("/resource/account/v2/{companyId}/{accountID}", account, vars);
 }
 public Task<Account> Create(Account account)
 {
     IDictionary<string, object> vars = new Dictionary<string, object>(1);
     vars.Add("companyId", this.companyId);
     return this.restTemplate.PostForObjectAsync<Account>("/resource/account/v2/{companyId}", account, vars);
 }