Skip to content

Unused TRoleClaim in Microsoft.Extensions.Identity.Stores.UserStore class #61763

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
1 task done
pournasserian opened this issue May 1, 2025 · 2 comments
Closed
1 task done
Labels
area-identity Includes: Identity and providers

Comments

@pournasserian
Copy link

Is there an existing issue for this?

  • I have searched the existing issues

Describe the bug

Here is the generic definitions in Microsoft.Extensions.Identity.Stores.UserStore (line 93):

where TUser : IdentityUser<TKey>
where TRole : IdentityRole<TKey>
where TContext : DbContext
where TKey : IEquatable<TKey>
where TUserClaim : IdentityUserClaim<TKey>, new()
where TUserRole : IdentityUserRole<TKey>, new()
where TUserLogin : IdentityUserLogin<TKey>, new()
where TUserToken : IdentityUserToken<TKey>, new()
where TRoleClaim : IdentityRoleClaim<TKey>, new()

The UserStore inherits from UserStoreBase.

None if them requires TRoleClaim and it is not used.

Expected Behavior

I think this line should be removed:

where TRoleClaim : IdentityRoleClaim<TKey>, new()

Steps To Reproduce

No response

Exceptions (if any)

No response

.NET Version

8

Anything else?

No response

@dotnet-issue-labeler dotnet-issue-labeler bot added the area-identity Includes: Identity and providers label May 1, 2025
@MackinnonBuck
Copy link
Member

MackinnonBuck commented May 5, 2025

Thanks for reaching out, @pournasserian.

The UserStore inherits from UserStoreBase.
None if them requires TRoleClaim and it is not used.

@HaoK, it does appear that the TRoleClaim generic parameter doesn't need to be in UserStoreBase. Do you happen to know why it was added in the first place?

Note that even if it could be removed, we wouldn't do so because it would be a breaking change.

@MackinnonBuck
Copy link
Member

Closing this out. We're interested in the history of this change but are not going to make a breaking change here.

@MackinnonBuck MackinnonBuck closed this as not planned Won't fix, can't repro, duplicate, stale May 5, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-identity Includes: Identity and providers
Projects
None yet
Development

No branches or pull requests

2 participants