public async Task <IActionResult> Signup([FromBody] SignupRequest request) { var cmd = new SignupCommand(new ProjectData("", ""), request.EmailAddress, request.Password, request.Username); var result = await mediator.Send(cmd); return(result.Match <IActionResult>(user => Ok(), BadRequest)); }
public async Task <IActionResult> Post([FromBody] SignUpToCourseDto signUpToCourseDto) { var command = new SignupCommand { SignUpToCourseDto = signUpToCourseDto }; var response = await _mediator.Send(command); return(Ok(response)); }
public async Task <ActionResult <JwtToken> > Signup([FromBody] SignupCommand command) { try { return(Ok(await Mediator.Send(command))); } catch (UnauthorizedAccessException e) { return(Unauthorized(e.Message)); } }
public SignupViewModel(IParentService parentService, IUserDialogs userDialogs, IMvxMessenger mvxMessenger, AppHelper appHelper) : base(userDialogs, mvxMessenger, appHelper) { _parentService = parentService; SignupCommand = ReactiveCommand .CreateFromObservable <Unit, ParentEntity>( (_) => _parentService.Register(FirstName, LastName, Birthdate, Email, PasswordClear, ConfirmPassword, String.Concat(Prefix, Telephone))); SignupCommand.Subscribe(AccountCreated); SignupCommand.IsExecuting.Subscribe((isLoading) => HandleIsExecuting(isLoading, AppResources.Signup_CreatingAccount)); SignupCommand.ThrownExceptions.Subscribe(HandleExceptions); }
private async Task pickCountry() { getCountrySubscription?.Dispose(); getCountrySubscription = null; var selectedCountryId = await navigationService .Navigate <SelectCountryViewModel, long?, long?>(countryId); if (selectedCountryId == null) { setCountryErrorIfNeeded(); return; } var selectedCountry = allCountries .Single(country => country.Id == selectedCountryId.Value); IsCountryErrorVisible = false; countryId = selectedCountry.Id; CountryButtonTitle = selectedCountry.Name; SignupCommand.RaiseCanExecuteChanged(); }
public MainVM() { User = new User(); LoginCommand = new LoginCommand(this); SignupCommand = new SignupCommand(this); }
private void OnIsLoadingChanged() => SignupCommand.RaiseCanExecuteChanged();
private void OnPasswordChanged() => SignupCommand.RaiseCanExecuteChanged();
private void OnEmailChanged() => SignupCommand.RaiseCanExecuteChanged();
public async Task <IActionResult> SignUp([FromBody] SignupCommand model) { return(Ok(await Mediator.Send(model))); }