Skip to content

Commit

Permalink
fix build
Browse files Browse the repository at this point in the history
  • Loading branch information
jonashendrickx committed Sep 21, 2023
1 parent 9afa124 commit 76d82f5
Showing 1 changed file with 10 additions and 13 deletions.
23 changes: 10 additions & 13 deletions src/Passwordless/Models/AddAliasRequest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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<string>(), hashing)
{
Aliases = new();
if (!string.IsNullOrWhiteSpace(alias))
{
Aliases = new() { alias };
}
}

public AddAliasRequest(string userId, HashSet<string> aliases, bool hashing = true)
: this(userId, hashing)
public AddAliasRequest(string userId, string alias, bool hashing = true)
: this(userId, new HashSet<string> { alias }, hashing)
{
if (aliases == null) return;

Aliases = new HashSet<string>(aliases.Where(x => !string.IsNullOrWhiteSpace(x)));
}

private AddAliasRequest(string userId, bool hashing = true)
public AddAliasRequest(string userId, HashSet<string> aliases, bool hashing = true)
{
UserId = userId ?? throw new ArgumentNullException(nameof(userId));
Hashing = hashing;

Aliases = aliases == null
? new HashSet<string>()
: new HashSet<string>(aliases.Where(x => !string.IsNullOrWhiteSpace(x)));
}

public string UserId { get; }

public HashSet<string> Aliases { get; }

/// <summary>
Expand Down

0 comments on commit 76d82f5

Please sign in to comment.