Esempio n. 1
0
        public async Task <UserDTO> Handle(CreateSingleUserCommand command)
        {
            var userAgg = UserAggregate.CreateNewUser(command.Input);
            await _session.Add(userAgg);

            await _session.Commit();

            var userDTO = _mapper.Map <UserDTO>(await _session.Get <UserAggregate>(userAgg.Id));

            _email.SendUserCreatedMessage(userDTO);
            return(userDTO);
        }