From 76d82f5c0306cf5af4f2155d704a4fd90d30f59d Mon Sep 17 00:00:00 2001 From: Jonas Hendrickx Date: Thu, 21 Sep 2023 14:21:33 +0200 Subject: [PATCH] fix build --- src/Passwordless/Models/AddAliasRequest.cs | 23 ++++++++++------------ 1 file changed, 10 insertions(+), 13 deletions(-) diff --git a/src/Passwordless/Models/AddAliasRequest.cs b/src/Passwordless/Models/AddAliasRequest.cs index 2f65204..0f215a7 100644 --- a/src/Passwordless/Models/AddAliasRequest.cs +++ b/src/Passwordless/Models/AddAliasRequest.cs @@ -2,31 +2,28 @@ namespace Passwordless.Models; public class AddAliasRequest { - public AddAliasRequest(string userId, string alias, bool hashing = true) - : this(userId, hashing) + public AddAliasRequest(string userId, bool hashing = true) + : this(userId, new HashSet(), hashing) { - Aliases = new(); - if (!string.IsNullOrWhiteSpace(alias)) - { - Aliases = new() { alias }; - } } - public AddAliasRequest(string userId, HashSet aliases, bool hashing = true) - : this(userId, hashing) + public AddAliasRequest(string userId, string alias, bool hashing = true) + : this(userId, new HashSet { alias }, hashing) { - if (aliases == null) return; - - Aliases = new HashSet(aliases.Where(x => !string.IsNullOrWhiteSpace(x))); } - private AddAliasRequest(string userId, bool hashing = true) + public AddAliasRequest(string userId, HashSet aliases, bool hashing = true) { UserId = userId ?? throw new ArgumentNullException(nameof(userId)); Hashing = hashing; + + Aliases = aliases == null + ? new HashSet() + : new HashSet(aliases.Where(x => !string.IsNullOrWhiteSpace(x))); } public string UserId { get; } + public HashSet Aliases { get; } ///