// GET: /<controller>/ public IActionResult Index() { var model = new AddressListViewModel(); var addresses = _addressRepository.AllAddresses(User).ToList(); foreach (var address in addresses) { model.Addresses.Add(_mapper.Map <AddressViewModel>(address)); } return(View()); }