コード例 #1
0
 public SignUpController(
     Logger consoleLogger,
     UserSignUpCommand command)
 {
     this.consoleLogger = consoleLogger;
     this.command       = command;
 }
コード例 #2
0
 public async Task <ActionResult <int> > SignUp([FromBody] UserSignUpCommand command)
 {
     return(Ok(await Mediator.Send(new ForumsRegisterUserCommand
     {
         Username = command.Username,
         Email = command.Email
     })));
 }
コード例 #3
0
 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);
 }
コード例 #4
0
 public async Task <ActionResult <bool> > Register(UserSignUpCommand command)
 {
     return(await Mediator.Send(command));
 }
コード例 #5
0
 public async Task <ActionResult <int> > SignUp([FromBody] UserSignUpCommand command)
 {
     return(Ok(new { Id = await Mediator.Send(command) }));
 }