Open asammad48 opened 3 months ago
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
public int Reputation { get; protected set; }
}
Any updates? We are facing the same problem that uses the ABP Framework with an existing database
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.