Hello,
In our company we decide to use Guid as a key instead of int. When we override default keys in Identity I recognize that I still have int in tables: AspNetRoleClaims, AspNetUserClaims ...
Is there anyway to use in these tables Guid instead of int? Its not a bug in our code, but I cannot stop thinking about bad database design because we have two types of keys, not one.
Thanks !
Any docs about this? @HaoK @ajcvickers
Docs are here. Short answer is you can't change the int keys, but you also should not need to. I don't know the details on why the model was defined with int keys here, but they don't interact with any of the other keys.
@ajcvickers Thanks for you feedback. IMO when you design a database you want to use the same type of keys everywhere. You can image how these keys works with our custom Repositories.
I don't see a reason why we shouldn't be able to override those?
@Ibro Because the Identity code is explicitly written to use ints for these entity types.
@ajcvickers IMO its not a good architecture. Do you think, other developers can use different types of keys for these columns in DB? If answer is yes, why not implement this feature.
Can we use generic types to provide custom column type for these attributes? Right now its even possible?
@konraddysput I'm not trying to defend it; that's just the way it is. Could it be changed? Yes, but it's very unlikely this will be high enough priority to ever happen given all the other things that have higher priority across ASP.NET.
@Ibro Because the Identity code is explicitly written to use ints for these entity types.
I clearly understand that I just don't understand what's the reasoning behind such decision and why we can't override those.
Most helpful comment
@ajcvickers IMO its not a good architecture. Do you think, other developers can use different types of keys for these columns in DB? If answer is yes, why not implement this feature.
Can we use generic types to provide custom column type for these attributes? Right now its even possible?