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)); }
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)); }