public async Task <IActionResult> RegisterContestParticipant(RegisterContestParticipantViewModel viewModel)
        {
            try
            {
                await _handlerDispatcher.ExecuteCommandAsync(new RegisterContestParticipantCommand
                {
                    RegisterContestParticipantViewModel = viewModel,
                    Scheme     = Request.Scheme,
                    Controller = "Account",
                    Action     = nameof(AccountController.ConfirmEmail)
                });
            }
            catch (Exception ex) when(ex is ValidationException || ex is UnableToCreateUserException)
            {
                if (ex is ValidationException validException)
                {
                    validException.ValidationResult.ForEach(res => ModelState.AddModelError(res.Key, res.Value));
                }
                if (ex is UnableToCreateUserException unableException)
                {
                    ModelState.AddErrors(unableException.Errors);
                }

                await FillRegisterContestParticipantViewData();

                return(View(viewModel));
            }

            var contestType = await _handlerDispatcher.ExecuteQueryAsync(new GetContestTypeForHomeQuery { Id = viewModel.ContestId });

            return(contestType == ContestType.Individual ?
                   RedirectToAction(nameof(IndividualContestController.Register), "IndividualContest", new { id = viewModel.ContestId }) :
                   RedirectToAction(nameof(TeamContestController.Register), "TeamContest", new { id = viewModel.ContestId }));
        }
        public async Task <IActionResult> RegisterContestParticipant(int contestId, UserType userType)
        {
            //TODO можно добавить отправку на клиент типа контеста индивидуальный или командный, чтобы не запрашивать его в POST методе
            var vm = new RegisterContestParticipantViewModel
            {
                ContestId          = contestId,
                UserType           = userType,
                IsUserTypeDisabled = true
            };

            await FillRegisterContestParticipantViewData();

            return(View(vm));
        }