Guidance Needed for Changing Primary Key from Guid to Long in ABP Framework Pre-built Features
We are facing challenges in changing the primary key from Guid to long in ABP's pre-built features, such as User Management and Roles Management. We are planning to use the ABP Framework with an existing database. Although we have attempted several approaches, including extending the AbpUser class and overriding the primary key, these methods have not been successful. We also tried customizing the ABP User and Identity modules, but this requires extensive code modifications.
Could you please suggest an effective way to change the primary key from Guid to long in these pre-built features, so we can utilize ABP's Identity Management and Feature Management seamlessly?
Thank you.
Unable to create a 'DbContext' of type ''. The exception 'Unable to determine the relationship represented by navigation 'AppUser.CreatorUser' of type 'AppUser'. Either manually configure the relationship, or ignore this property using the '[NotMapped]' attribute or by using 'EntityTypeBuilder.Ignore' in 'OnModelCreating'.' was thrown while attempting to create an instance. For the different patterns supported at design time, see https://go.microsoft.com/fwlink/?linkid=851728
I am getting this error. When adding a migration
` base.OnModelCreating(builder);
/* Include modules to your migration db context */
builder.Entity<AppUser>(b =>
{
b.ToTable("AbpUsers");
b.ConfigureByConvention();
b.HasOne<IdentityUser>().WithOne().HasForeignKey<AppUser>(x => x.Id);
});
builder.ConfigurePermissionManagement();
builder.ConfigureSettingManagement();
builder.ConfigureBackgroundJobs();
builder.ConfigureAuditLogging();
builder.ConfigureIdentity();
builder.ConfigureOpenIddict();
builder.ConfigureFeatureManagement();
builder.ConfigureTenantManagement();`
public class AppUser : AbpUser<AppUser> { public override long Id { get; set; } public long ExistingDbID { get; set; } public string Title { get; protected set; } = "";
public int Reputation { get; protected set; }
}
Any updates? We are facing the same problem that uses the ABP Framework with an existing database
Excuse me, have you found a suitable solution?
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.