From 769a423cdd4ba535e8655569817fd4e289b81cb6 Mon Sep 17 00:00:00 2001 From: Jared McCannon Date: Wed, 28 Feb 2024 17:48:32 -0600 Subject: [PATCH] Init properties cannot be deserialized with source generation. Switching to optional parameters. (#120) --- src/Passwordless/Models/Credential.cs | 24 +++++++----------------- 1 file changed, 7 insertions(+), 17 deletions(-) diff --git a/src/Passwordless/Models/Credential.cs b/src/Passwordless/Models/Credential.cs index 5b5e1f4..7953c84 100644 --- a/src/Passwordless/Models/Credential.cs +++ b/src/Passwordless/Models/Credential.cs @@ -20,6 +20,9 @@ namespace Passwordless; /// Device the credential was created on. /// Friendly name for credential. /// Identifier for the user. +/// Whether the credential is synced (or backed up or not). +/// Whether the credential is eligible for backup or syncing. +/// Whether the credential is discoverable. public record Credential( CredentialDescriptor Descriptor, byte[] PublicKey, @@ -34,20 +37,7 @@ public record Credential( string Country, string Device, string Nickname, - string UserId) -{ - /// - /// Whether the credential is synced (or backed up or not). - /// - public bool? BackupState { get; init; } - - /// - /// Whether the credential is eligible for backup or syncing. - /// - public bool? IsBackupEligible { get; init; } - - /// - /// Whether the credential is discoverable. - /// - public bool? IsDiscoverable { get; init; } -} \ No newline at end of file + string UserId, + bool? BackupState = null, + bool? IsBackupEligible = null, + bool? IsDiscoverable = null); \ No newline at end of file