diff --git a/src/SimpleAuthentication.Abstractions/ApiKey/ApiKey.cs b/src/SimpleAuthentication.Abstractions/ApiKey/ApiKey.cs index 0cc38e4..915bcbb 100644 --- a/src/SimpleAuthentication.Abstractions/ApiKey/ApiKey.cs +++ b/src/SimpleAuthentication.Abstractions/ApiKey/ApiKey.cs @@ -6,7 +6,7 @@ namespace SimpleAuthentication.ApiKey; /// The API key value /// The user name associated with the current key /// The list of roles to assign to the user -public record class ApiKey(string Value, string UserName, IEnumerable Roles) +public record class ApiKey(string Value, string UserName, IEnumerable? Roles = null) { /// public virtual bool Equals(ApiKey? other) @@ -25,8 +25,5 @@ public virtual bool Equals(ApiKey? other) } /// - public override int GetHashCode() - { - return HashCode.Combine(Value, UserName); - } + public override int GetHashCode() => HashCode.Combine(Value, UserName); } diff --git a/src/SimpleAuthentication.Abstractions/BasicAuthentication/Credential.cs b/src/SimpleAuthentication.Abstractions/BasicAuthentication/Credential.cs index 8b1471e..93d8331 100644 --- a/src/SimpleAuthentication.Abstractions/BasicAuthentication/Credential.cs +++ b/src/SimpleAuthentication.Abstractions/BasicAuthentication/Credential.cs @@ -6,7 +6,7 @@ namespace SimpleAuthentication.BasicAuthentication; /// The user name /// The password /// The list of roles to assign to the user -public record class Credential(string UserName, string Password, IEnumerable Roles) +public record class Credential(string UserName, string Password, IEnumerable? Roles = null) { /// public virtual bool Equals(Credential? other) @@ -25,8 +25,5 @@ public virtual bool Equals(Credential? other) } /// - public override int GetHashCode() - { - return HashCode.Combine(UserName, Password); - } + public override int GetHashCode() => HashCode.Combine(UserName, Password); }