コード例 #1
0
        public async Task <ValidationResult> ExternalRegistration(RegistrationViewModel vm)
        {
            RegistrationBindingModel accountForm = new RegistrationBindingModel
            {
                UserName  = vm.LoginTextBox,
                Password  = vm.PasswordTextBox,
                FirstName = vm.FirstNameTextBox,
                LastName  = vm.LastNameTextBox,
                Email     = vm.EmailTextBox,
                Role      = vm.Role
            };

            var validationResult = RegistrationForm.IsValid(
                accountForm,
                vm.ManagerChecked,
                vm.DeveloperChecked,
                vm.ViewerChecked);

            if (validationResult.IsValid)
            {
                var httpDataService = new HttpDataService();
                await httpDataService.Register(accountForm);
            }

            return(validationResult);
        }