Hi,
I can't reproduce the problem, could you provide the full steps to reproduce? thanks.
Hi,
See: https://docs.abp.io/en/commercial/latest/abp-suite/generating-crud-page#navigation-properties
ABP Suite allows you to create a navigation property for 1-to-many (1:N) and many-to-many (N:N) relationships.
You can't do it with the ABP suite, but it's easy to do yourself:
public class MyEntity1 : AggregateRoot<Guid>
{
public MyEntity1(Guid id)
{
Id = id;
}
public string Name { get; set; }
public Guid MyEntity2Id { get; set; }
public virtual MyEntity2 MyEntity2 { get; set; }
}
public class MyEntity2 : AggregateRoot<Guid>
{
public MyEntity2(Guid id)
{
Id = id;
}
public string Name { get; set; }
public Guid MyEntity1Id { get; set; }
public virtual MyEntity1 MyEntity1 { get; set; }
}
public DbSet<MyEntity1> MyEntityTest { get; set; }
public DbSet<MyEntity2> MyEntityTest2 { get; set; }
builder.Entity<MyEntity1>(b =>
{
b.HasOne(x => x.MyEntity2)
.WithOne(x => x.MyEntity1)
.HasForeignKey<MyEntity2>(x => x.MyEntity1Id)
.OnDelete(DeleteBehavior.Cascade);
});
public class TestAppService : QaAppService
{
private readonly IRepository<MyEntity1> _myEntity1Repository;
public TestAppService(IRepository<MyEntity1> myEntity1Repository)
{
_myEntity1Repository = myEntity1Repository;
}
public async Task CreateAsync()
{
var entity1Id = GuidGenerator.Create();
var entity2Id = GuidGenerator.Create();
var entity = new MyEntity1(entity1Id)
{
Name = "test",
MyEntity2Id = entity2Id,
MyEntity2 = new MyEntity2(entity2Id)
{
MyEntity1Id = entity1Id,
Name = "test2"
}
};
await _myEntity1Repository.InsertAsync(entity);
}
public async Task DeleteAsync()
{
var entity = await (await _myEntity1Repository.GetQueryableAsync()).Include(x=>x.MyEntity2).FirstOrDefaultAsync();
await _myEntity1Repository.DeleteAsync(entity);
}
}
Deleting a Myentity1 will also delete the Myentity2, but, of course, not the other way around
Note: Only deleting the principal entity will cascade delete the dependent entity. Vice-versa is not possible.
If you want to delete any entity, the records of other tables will be deleted. You need to delete them manually.
Hi,
Abp templates no longer use identityserver from 6.0, there is no Identity Server menu.
Did you make changes to the template? it's better if you can share a project with me. shiwei.liang@volosoft.com thanks.
Hi,
I will check it.
Hi,
You should customize the registration page for your case: https://docs.abp.io/en/abp/latest/UI/AspNetCore/Customization-User-Interface
The Register page is MVC UI
Hi,
Please provide the full steps to reproduce the problem, thanks.