aspnet / Identity

[Archived] ASP.NET Core Identity is the membership system for building ASP.NET Core web applications, including membership, login, and user data. Project moved to https://github.com/aspnet/AspNetCore
Apache License 2.0
1.97k stars 871 forks source link

Can't use GUID identifier on IdentityRoleClaim and IdentityUserClaim #1973

Closed dragankae closed 5 years ago

dragankae commented 5 years ago

I'm not able to use GUID identifier on IdentityRoleClaim and IdentityUserClaim classes. TKey is not set on the Id.

capture

jamiewest commented 5 years ago

Looks like you would need to override Id with TKey or whatever data type you want to use and potentially create a constructor to initialize the variable. Deriving this would also require that you create derived instances of the stores and manager as well. Is there a specific reason why you need this PK to be a different data type? Also, are there instances where the data type would be different that of TKey.

dragankae commented 5 years ago

I wanted to use Guid types for my identifiers and I noticed that TKey is not set on the Id in IdentityRoleClaim and IdentityUserClaim while is set on IdentityRole and IdentityUser. That kind a confused me, but anyway i will try with your suggestion with overriding.