Aperto Chiuso

Navigation property to IdentityUser (AbpUser) from module DbContext which is in a separate database from the dbo.AbpUsers table #3637


User avatar
0
mel@quadsoftpa.com creato
  • ABP Framework version: 6rc3
  • UI type: Blazor
  • DB provider: EF Core
  • Tiered (MVC) or Identity Server Separated (Angular): mvc

I didn't get any response to my first inquiry, so I'm trying again. I've seen all kinds of questions about this, but I've never seen it asked specifically about a second database. probably the best thing to do is for me to give you my module code. Would you be willing to take a look at this and if so let me know where I can send. Thank you!


2 risposte
  • User Avatar
    0
    mel@quadsoftpa.com creato

    this is my entity configuration

    builder.Entity<CommunityAgent>(b => { b.ToTable(DataManagementDbProperties.DbTablePrefix + "CommunityAgents", DataManagementDbProperties.SchemaCommunity); b.ConfigureByConvention(); b.HasKey(x => new { x.IdentityUserId, x.CommunityId }); b.HasOne<Community>() .WithMany() .IsRequired() .HasForeignKey(x => x.CommunityId) .OnDelete(DeleteBehavior.NoAction); b.HasOne<IdentityUser>() .WithMany() .IsRequired() .HasForeignKey(x => x.IdentityUserId) .OnDelete(DeleteBehavior.NoAction); });

  • User Avatar
    0
    gterdem creato
    Team di supporto Senior .NET Developer

    Do you get errors when migrating the database because of fluent API configuration?

    Can you explain in details about the problem you are having?

Made with ❤️ on ABP v8.2.0-preview Updated on marzo 25, 2024, 15:11