private async Task AddDeviceInfoAsync(IAgentContext agentContext, ConnectionRecord connection, AddDeviceInfoMessage addDeviceInfoMessage) { var inboxId = connection.GetTag("InboxId"); if (inboxId == null) { throw new InvalidOperationException("Inbox was not found. Create an inbox first"); } var deviceRecord = new DeviceInfoRecord { InboxId = inboxId, DeviceId = addDeviceInfoMessage.DeviceId, DeviceVendor = addDeviceInfoMessage.DeviceVendor }; try { await recordService.AddAsync(agentContext.Wallet, deviceRecord); } catch (WalletItemAlreadyExistsException) { } catch (Exception e) { logger.LogError(e, "Unable to register device", addDeviceInfoMessage); } }
private async Task AddDeviceInfoAsync(IAgentContext agentContext, ConnectionRecord connection, AddDeviceInfoMessage addDeviceInfoMessage) { var inboxId = connection.GetTag("InboxId"); if (inboxId == null) { throw new InvalidOperationException("Inbox was not found. Create an inbox first"); } var deviceRecord = new DeviceInfoRecord { InboxId = inboxId, DeviceId = addDeviceInfoMessage.DeviceId, DeviceVendor = addDeviceInfoMessage.DeviceVendor }; await recordService.AddAsync(agentContext.Wallet, deviceRecord); }