public SignUpController(
     Logger consoleLogger,
     UserSignUpCommand command)
 {
     this.consoleLogger = consoleLogger;
     this.command       = command;
 }
 public async Task <ActionResult <int> > SignUp([FromBody] UserSignUpCommand command)
 {
     return(Ok(await Mediator.Send(new ForumsRegisterUserCommand
     {
         Username = command.Username,
         Email = command.Email
     })));
 }
 public void Init()
 {
     userRepository = new Mock <UserRepository>();
     hashingService = new Mock <HashingService>();
     securePseudoRandomGenerator = new Mock <SecurePseudoRandomGenerator>();
     command = new UserSignUpCommand(
         userRepository: userRepository.Object,
         hashingService: hashingService.Object,
         securePseudoRandomGenerator: securePseudoRandomGenerator.Object);
 }
Esempio n. 4
0
 public async Task <ActionResult <bool> > Register(UserSignUpCommand command)
 {
     return(await Mediator.Send(command));
 }
Esempio n. 5
0
 public async Task <ActionResult <int> > SignUp([FromBody] UserSignUpCommand command)
 {
     return(Ok(new { Id = await Mediator.Send(command) }));
 }