File tree Expand file tree Collapse file tree 2 files changed +4
-10
lines changed
src/SimpleAuthentication.Abstractions Expand file tree Collapse file tree 2 files changed +4
-10
lines changed Original file line number Diff line number Diff line change @@ -6,7 +6,7 @@ namespace SimpleAuthentication.ApiKey;
66/// <param name="Value">The API key value</param>
77/// <param name="UserName">The user name associated with the current key</param>
88/// <param name="Roles">The list of roles to assign to the user</param>
9- public record class ApiKey ( string Value , string UserName , IEnumerable < string > Roles )
9+ public record class ApiKey ( string Value , string UserName , IEnumerable < string > ? Roles = null )
1010{
1111 /// <inheritdoc />
1212 public virtual bool Equals ( ApiKey ? other )
@@ -25,8 +25,5 @@ public virtual bool Equals(ApiKey? other)
2525 }
2626
2727 /// <inheritdoc />
28- public override int GetHashCode ( )
29- {
30- return HashCode . Combine ( Value , UserName ) ;
31- }
28+ public override int GetHashCode ( ) => HashCode . Combine ( Value , UserName ) ;
3229}
Original file line number Diff line number Diff line change @@ -6,7 +6,7 @@ namespace SimpleAuthentication.BasicAuthentication;
66/// <param name="UserName">The user name</param>
77/// <param name="Password">The password</param>
88/// <param name="Roles">The list of roles to assign to the user</param>
9- public record class Credential ( string UserName , string Password , IEnumerable < string > Roles )
9+ public record class Credential ( string UserName , string Password , IEnumerable < string > ? Roles = null )
1010{
1111 /// <inheritdoc />
1212 public virtual bool Equals ( Credential ? other )
@@ -25,8 +25,5 @@ public virtual bool Equals(Credential? other)
2525 }
2626
2727 /// <inheritdoc />
28- public override int GetHashCode ( )
29- {
30- return HashCode . Combine ( UserName , Password ) ;
31- }
28+ public override int GetHashCode ( ) => HashCode . Combine ( UserName , Password ) ;
3229}
You can’t perform that action at this time.
0 commit comments