public ActionResult ViewAccounts() { _accountsViewModel = new AccountsViewModel(); try { List <Account> accounts = _accountProcessor.GetAccounts(); List <AccountModel> accountsModel = new List <AccountModel>(); if (accounts != null && accounts.Any()) { accountsModel = BuildToAccountModel(accounts); } _accountsViewModel.Accounts = accountsModel; return(View("ViewAccounts", _accountsViewModel)); } catch (CrmDataException ex) { _logger.Error(ex); throw new CrmDataException(ex); } catch (Exception ex) { _logger.Error(ex); return(ViewMensajeModel(_messageException, TipoMensajeEnum.Error)); } }