Exemplo n.º 1
0
 public ConfirmEmailModel(IRegisterAccountService registerAccountService)
 {
     this._registerAccountService = registerAccountService;
 }
Exemplo n.º 2
0
        public async Task <IActionResult> Register([FromBody] RegisterDto registerDto, [FromServices] IRegisterAccountService service)
        {
            var registerValidator = new EmailValidator();
            var validatorResult   = await registerValidator.ValidateAsync(registerDto);

            if (validatorResult.IsValid)
            {
                await service.RegisterAccount(registerDto);

                if (!service.Status.HasErrors)
                {
                    return(Ok());
                }
                return(BadRequest(service.Status.Errors));
            }

            var validationErrors = validatorResult.Errors.Select(error => new ValidationResult(error.ErrorMessage))
                                   .ToImmutableList();

            return(BadRequest(validationErrors));
        }
Exemplo n.º 3
0
 public IndexModel(IRegisterAccountService registerAccountService)
 {
     _registerAccountService = registerAccountService;
 }
Exemplo n.º 4
0
 public RegisterModel(
     IRegisterAccountService registerAccountService)
 {
     this._registerAccountService = registerAccountService;
 }