public async Task <IActionResult> Post([FromBody] CreateUserModel model) { var createUserRequest = new CreateUserRequest(model.UserName, model.Password, model.Roles); await _createUserUseCase.Handle(createUserRequest, _createUserPresenter); return(_createUserPresenter.ActionResult); }
public async Task <IActionResult> Post([FromBody] NewUserCommand command) { if (ModelState.IsValid) { await _createUserUseCase.Handle( new CreateUserRequest(command.Email, command.PasswordHash), _createUserPresenter ); if (_createUserPresenter.Succeeded) { return(Created($"api/user/{_createUserPresenter.Id}", _createUserPresenter.ContentResult)); } else { return(_createUserPresenter.ContentResult); } } return(BadRequest(ModelState)); }
public async Task <bool> Create(CreateUserRequest message, IOutputPort <CreateUserResponse> outputPort) { return(await _createUserUseCase.Handle(message, outputPort)); }