Accounts() public method

https://api.test.nordnet.se/projects/api/wiki/REST_API_documentation#Get-accounts
public Accounts ( ) : Task>
return Task>
Example #1
0
 public NextVm(NextClient client)
 {
     _client = client;
     PublicFeed = new FeedVm(_client.PublicFeed);
     PrivateFeed = new FeedVm(_client.PrivateFeed);
     _client.LoggedInChanged += async (_, e) =>
         {
             OnPropertyChanged("IsLoggedIn");
             if (IsLoggedIn)
             {
                 List<InstrumentList> instrumentLists = await _client.Lists();
                 foreach (var instrumentList in instrumentLists.OrderBy(x => x.Name))
                 {
                     InstrumentLists.Add(new InstrumentListVm(instrumentList, _client));
                 }
                 List<Account> accounts = await _client.Accounts();
                 accounts.ForEach(Accounts.Add);
             }
         };
     Accounts.CollectionChanged += (o, e) =>
         {
             if (Account.Account != null || Accounts.Count > 1)
                 return;
             Account.Account = Accounts.First();
         };
     Account = new AccountVm(_client, null);
     var loginVm = new LoginVm();
     if (loginVm.Username != null && loginVm.Password != null)
     {
         _client.Login(loginVm.Username, loginVm.Password);
     }
 }