示例#1
0
        public IActionResult Secrets(int clientId)
        {
            LoadCachedModelState();
            var secretsResult = m_secretManager.GetSecretsForClient(clientId);

            if (secretsResult.HasError)
            {
                ModelState.AddModelError(secretsResult.Error.Message);
                return(View());
            }

            var secretViewModels = Mapper.Map <IList <SecretViewModel> >(secretsResult.Result);

            var vm = ViewModelFactory.GetClientSecretsViewModel(secretViewModels, clientId,
                                                                Translator.Translate("delete-secret-confirm-dialog-title"),
                                                                Translator.Translate("delete-secret-confirm-dialog-message"));

            return(View(vm));
        }