public IActionResult Get() { var accounts = _repo.GetAccountsByUser(User.Identity.Name); ICollection <AccountViewModel> accountsVM = new List <AccountViewModel>(); _vmFactory = new VMFactory(_mapper); foreach (Account account in accounts) { var accountVM = _vmFactory.CreateAccountVM(account, Url); } return(Ok(accountsVM)); }