Hi,
I can't reproduce the problem, could you share a project that can reproduce it with me? thanks. shiwei.liang@volosoft.com
Can you try to use CLI create a new project and deploy it to a new server(or virtual machine) to test again?
Hi,
Can you share the full steps to reproduce and I will check it out, thanks.
Hi,
The ABP studio is our new product and it is still under development.
We will introduce it when it's done
Hi,
I can reproduce the problem, can you create a new project to reproduce and send it to me by email? shiwei.liang@volosoft.com Thanks.
In this way, your service will use the same database as the identity service.
In microservices, this is not good, but it's up to you.
This is another way, you can have redundant users in the service as we did: https://github.com/abpframework/abp/blob/dev/modules/cms-kit/src/Volo.CmsKit.Domain/Volo/CmsKit/Users/CmsUser.cs https://github.com/abpframework/abp/blob/dev/modules/cms-kit/src/Volo.CmsKit.Domain/Volo/CmsKit/Users/CmsUserSynchronizer.cs
The nice thing about it is that you don't have to depend on the identity module
Hi,
You can try this:
Volo.Abp.Identity.Pro.Domain to your Domain projectVolo.Abp.Identity.Pro.EntityFrameworkCore to your EntityFrameworkCore projectDomain
public class AgencyUser : FullAuditedAggregateRoot<Guid>
{
public Guid IdentityUserId { get; set; }
public IdentityUser IdentityUser { get; set; }
public Guid AgencyId { get; set; }
public Agency Agency { get; set; }
}
public class Agency : Entity<Guid>
{
public string Name { get; set; }
}
EntityFrameworkCore
public class AgencyUserMap : IEntityTypeConfiguration<AgencyUser>
{
public void Configure(EntityTypeBuilder<AgencyUser> builder)
{
builder.ConfigureByConvention();
builder.ToTable("AgencyUser");
builder.HasKey(x => x.Id);
builder.Property(x => x.Id).ValueGeneratedOnAdd();
builder.HasOne<IdentityUser>().WithMany().HasForeignKey(x => x.IdentityUserId);
builder.HasOne<Agency>().WithMany().HasForeignKey(x => x.AgencyId);
builder.Navigation(x => x.IdentityUser).AutoInclude();
builder.Navigation(x => x.Agency).AutoInclude();
builder.ApplyObjectExtensionMappings();
}
}
builder.ApplyConfiguration(new AgencyUserMap());
builder.Entity<Agency>(b =>
{
b.ToTable("Agency");
b.ApplyObjectExtensionMappings();
});
[ReplaceDbContext(typeof(IIdentityProDbContext))]
[ConnectionStringName(MyServiceDbProperties.ConnectionStringName)]
public class MyServiceDbContext : AbpDbContext<MyServiceDbContext> , IIdentityProDbContext
{
// Identity
public DbSet<IdentityUser> Users { get; set; }
public DbSet<IdentityRole> Roles { get; set; }
public DbSet<IdentityClaimType> ClaimTypes { get; set; }
public DbSet<OrganizationUnit> OrganizationUnits { get; set; }
public DbSet<IdentitySecurityLog> SecurityLogs { get; set; }
public DbSet<IdentityLinkUser> LinkUsers { get; set; }
public DbSet<AgencyUser> AgencyUsers { get; set; }
public DbSet<Agency> Agencies { get; set; }
public MyServiceDbContext(DbContextOptions<MyServiceDbContext> options)
: base(options)
{
}
protected override void OnModelCreating(ModelBuilder builder)
{
base.OnModelCreating(builder);
builder.ConfigureIdentityPro();
builder.ConfigureMyService();
}
}
Hi,
Add reference to package: Volo.Abp.IdentityServer.Domain to EntityFrameworkCore and Domain projects
I remember that ABP app pro startup template already preinstalled those modules, are you using a module template?