public async Task <IActionResult> SendMessageAsync([FromBody] AddMessageToPairViewModel viewModel)
        {
            var command = new AddMessageToPairCommand(new AggregateId(viewModel.PairId), new AggregateId(viewModel.ToUserId), viewModel.Message);
            await _commandQueryDispatcherDecorator.DispatchAsync(command);

            return(Ok());
        }
Exemple #2
0
        public async Task <IActionResult> Register([FromBody] RegisterUserViewModel viewModel)
        {
            var command = new RegisterUserCommand(
                viewModel.UserName,
                viewModel.FirstName,
                viewModel.SecondName,
                viewModel.Email,
                viewModel.Gender,
                viewModel.BirthDate,
                viewModel.Password,
                viewModel.ConfirmPassword);

            await _commandQueryDispatcherDecorator.DispatchAsync(command);

            return(Ok());
        }