I'm using ASP.Net Core 2.2 Identity and it generates all required tables for me where the primary key for AspNetUsers and AspNetRoles are string fields.
Here is my ApplicationUser:
public class ApplicationUser : IdentityUser
{
public int StaffId { get; set; }
public string JobTitle { get; set; }
public string FullName { get; set; }
}
How can I set a custom integer field (staffId) as primary key of the AspNetUsers table and change the data type of AspNetRoles.Id from string to integer?
[Key]attribute on your field or using the genericIdentityUserpassing in your custom type? That type would have to implementIEquatable- Richard Barker