Ejemplo n.º 1
0
        public async Task <IActionResult> SignUpWithService(SignUpCmd dto)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest("Invalid"));
            }

            await _identityService.SignUpAsync(dto.Email, dto.Password);

            return(NoContent());
        }
Ejemplo n.º 2
0
        public async Task <IActionResult> SignUp(SignUpCmd command)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest("Invalid"));
            }

            await _dispatcher.SendAsync(command.BindId(c => c.CommandId));

            return(NoContent());
        }
        public async Task <IActionResult> SignUp([FromBody] SignUpCmd cmd,
                                                 [FromServices] ICommandHandlerAsync <SignUpCmd> handler)
        {
            if (!ModelState.IsValid)
            {
                var errors = GetErrors();
                throw new CustomException((int)ExceptionCode.Validation, errors);
            }

            await this._dispatcher.PushAsync(handler, cmd);

            _logger.LogInformation("Sign Up new User");
            return(Json(new Json()));
        }
Ejemplo n.º 4
0
 public async Task <IActionResult> SignUp(SignUpCmd command)
 => await SendAsync(command.BindId(c => c.CommandId), resourceId : command.CommandId, resource : "identity");