Beispiel #1
0
        public async Task <IActionResult> Index([FromForm] InstallModel model)
        {
            if (!ModelState.IsValid)
            {
                var vm = this.CreateViewModel(model);
                vm.ErrorMessage = L["Invalid request"];
                return(this.View(vm));
            }

            var result = await InstallService.TryInstallAsync(model);

            if (result.Success)
            {
                return(RedirectToAction("Index", "Home"));
            }
            else
            {
                var vm = this.CreateViewModel(model);
                vm.ErrorMessage = result.ErrorMessage;
                return(this.View(vm));
            }
        }