예제 #1
0
            public override async Task Handle(SignupUserServiceRequest request)
            {
                IdentityContext.Logins.Add(new UserLogin(request.Username, request.Password));

                await IdentityContext.Save();

                _messageBus.Publish(new UserSignuped(request.Username));
            }
예제 #2
0
            public override async Task Handle(UpdateUserLoginServiceRequest request)
            {
                var login = await IdentityContext
                            .Logins
                            .SingleAsync(item => item.Username.Value == request.Username);

                login.Update(request.NewUsername, request.NewPassword);

                await IdentityContext.Save();

                _busPublisher.Publish(new UserUpdated(request.Username, request.NewUsername));
            }