public HttpResponseMessage ChangePassword(long userId, string clientId) { var command = new ForceUserLogin() { UserId = userId, ClientId = clientId }; this.commandBus.Send(command); return(new HttpResponseMessage(HttpStatusCode.OK)); }
public void Handle(ForceUserLogin command) { var clientIds = this.userDeviceRepository.GetListClientId(command.UserId); foreach (var clientId in clientIds) { if (clientId == command.ClientId) { continue; } var key = string.Format("{0}:{1}:{2}", this.UserDevicePrefixNamespace, command.UserId, clientId); var userDevice = new UserDevice(command.UserId, clientId); userDevice.SetNeedLoginTo(true); var value = JsonConvert.SerializeObject(userDevice); this.redisWriteClient.Set(key, value); } }