[maliming] said: hi
Does this solution work for you?
Thanks.
Hi,
We didn't try that as the below note (copied from the other thread) indicated that it might cause issues later on: It seems to work with the given overrides. However, it's sad that by implementing these overrides we have the risks of possible missing feature updates and even future breaking changes.
Thanks.
It seems I cannot submit technical support related topics on https://abp.io/contact
Could you forward this request to ABP Support?
Thanks.
Hi,
We are using the commercial license with version 9.3.2. I have noticed that the LastModificationTime is not updated when updating a one-to-many relationship in a full audited entity. I found below related thread https://abp.io/support/questions/10057/LastModification-fields-not-updated-when-changing-one-to-many-relationship
The last comment on above thread was 'We will improve it in the next 9.3.x patch version.'
Could you confirm the version which has the patch released with?
Thanks.
[maliming] said: hi
ABP soft delete actual do a update operator. So your
OnDeletewon't be called.You can add an event handler
EntityUpdatedEventData<IdentityUser>and check ifIsDeletedis true or false.Thanks.
Hi,
Thanks for your response on this. We'll look into these options.
Thanks.
Thanks for the clarification.
In our case, the Manager is deleted through the built-in Identity Management → Users page (i.e., the default user deletion flow provided by ABP).
Given that, how can we customize this flow so we can implement the following approach?
Override/customize the user deletion process in our application/domain service and explicitly update dependent entities (e.g., set Employee.ManagerId = null) before or after the user is soft-deleted.
What is the recommended way in ABP to hook into or override the built-in user deletion logic used by the Identity Management module so we can safely apply our custom logic when a user is deleted from the UI?
Hi,
We encountered a scenario where an entity (with its own entity type configuration) contains a nullable reference to IdentityUser.
In the entity configuration, we specified:
.OnDelete(DeleteBehavior.SetNull)
However, when the related IdentityUser is soft deleted, the reference is not updated to null. As a result, the entity continues to reference a soft-deleted IdentityUser, effectively creating a broken reference.
We are currently using ABP.IO version 9.3.2 (commercial license).
Our expectation was that ABP’s soft delete mechanism would also honor OnDelete(DeleteBehavior.SetNull) and automatically set the foreign key to null. However, this does not seem to be happening.
Could you please confirm whether ABP.IO handles soft delete scenarios together with OnDelete(DeleteBehavior.SetNull)? If it does, could you clarify how to achieve the expected behavior?
See below code as an example:
public class Employee : FullAuditedEntity<int>
{
public Guid? ManagerId { get; set; }
[ForeignKey(nameof(ManagerId))]
public IdentityUser? IdentityUser { get; set; }
public Employee()
{
}
}
public sealed class EmployeeConfig : IEntityTypeConfiguration<Employee>
{
public void Configure(EntityTypeBuilder<Employee> builder)
{
builder.ToTable(FfWConsts.DbTablePrefix + "Employees", FfWConsts.DbSchema);
builder.ConfigureByConvention();
builder.HasOne(p => p.IdentityUser).WithMany().HasForeignKey(x => x.ManagerId).OnDelete(DeleteBehavior.SetNull);
}
}