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; } ///