diff --git a/Beacon.Sdk.Sample.Console/DependencyInjectionSample.cs b/Beacon.Sdk.Sample.Console/DependencyInjectionSample.cs index 138506f..362401e 100644 --- a/Beacon.Sdk.Sample.Console/DependencyInjectionSample.cs +++ b/Beacon.Sdk.Sample.Console/DependencyInjectionSample.cs @@ -131,9 +131,9 @@ public async Task Run(IServiceProvider serviceProvider) byte[] decodedBytes = Base58CheckEncoding.Decode(qrCode); string message = Encoding.Default.GetString(decodedBytes); - + P2PPairingRequest pairingRequest = JsonConvert.DeserializeObject(message); - + await walletClient.AddPeerAsync(pairingRequest!); Console.ReadLine(); diff --git a/Beacon.Sdk/Core/Domain/Interfaces/Data/IPermissionInfoRepository.cs b/Beacon.Sdk/Core/Domain/Interfaces/Data/IPermissionInfoRepository.cs index d32379d..f2ce31e 100644 --- a/Beacon.Sdk/Core/Domain/Interfaces/Data/IPermissionInfoRepository.cs +++ b/Beacon.Sdk/Core/Domain/Interfaces/Data/IPermissionInfoRepository.cs @@ -5,7 +5,7 @@ namespace Beacon.Sdk.Core.Domain.Interfaces.Data public interface IPermissionInfoRepository { - Task Create(PermissionInfo permissionInfo); + Task CreateOrUpdate(PermissionInfo permissionInfo); Task TryRead(string accountIdentifier); } diff --git a/Beacon.Sdk/Core/Domain/ResponseMessageHandler.cs b/Beacon.Sdk/Core/Domain/ResponseMessageHandler.cs index f82dced..30ebaf9 100644 --- a/Beacon.Sdk/Core/Domain/ResponseMessageHandler.cs +++ b/Beacon.Sdk/Core/Domain/ResponseMessageHandler.cs @@ -58,7 +58,7 @@ private string HandlePermissionResponse(string receiverId, PermissionResponse re response.Network, response.Scopes); - _permissionInfoRepository.Create(info); + _permissionInfoRepository.CreateOrUpdate(info); return _jsonSerializerService.Serialize(response); } diff --git a/Beacon.Sdk/Core/Infrastructure/Repositories/LiteDbPermissionInfoRepository.cs b/Beacon.Sdk/Core/Infrastructure/Repositories/LiteDbPermissionInfoRepository.cs index daf6ddf..24effd5 100644 --- a/Beacon.Sdk/Core/Infrastructure/Repositories/LiteDbPermissionInfoRepository.cs +++ b/Beacon.Sdk/Core/Infrastructure/Repositories/LiteDbPermissionInfoRepository.cs @@ -12,9 +12,9 @@ public LiteDbPermissionInfoRepository(ILogger lo { } - public Task Create(PermissionInfo permissionInfo) => InConnection(col => + public Task CreateOrUpdate(PermissionInfo permissionInfo) => InConnection(col => { - col.Insert(permissionInfo); + col.Upsert(permissionInfo); col.EnsureIndex(x => x.AccountIdentifier); return Task.FromResult(permissionInfo);