-
Notifications
You must be signed in to change notification settings - Fork 3.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Mark AggreateRoot as modified #19060
Comments
hi What is your ABP Framework version? Can you share a test project? Thanks. |
Hi, sure. ABP Framework version: 8.0.3 It's a newly generated project. Code Test |
HI, maybe not related... But I notice another thing. If in DbContextModelCreatingExtensions we set HasDefaultValue for property.
in AbpDbContext.cs In the same method that is responsible for emitting events There is condition but with HasDefaultValue: x.Metadata.ValueGenerated == 'OnAdd' I think that correct condition should be |
hi The EF Core has an issue; We can't know whether the aggregate root has changed when deleting the child collection. |
Hi, I think there may be more cases. For example, changing the Child Entity of Child entity. So I would suggest as a fallback to add some dummy property to BasicAggreageRoot, which we can set with I currently set LastModificatioTime = null as a fallback. Which will mark the entity as Modified. |
We should wait for EF Core to support it. |
Done by #19079 |
If you don't use Include to load the sub-navigation properties at the beginning, and use Such as: abp/modules/identity/src/Volo.Abp.Identity.Domain/Volo/Abp/Identity/IdentityUserManager.cs Lines 192 to 199 in 63b8d55
It does not trigger |
|
Is there an existing issue for this?
Is your feature request related to a problem? Please describe the problem.
According to AggregateRoot Class I would expect that if I am working with Order as a single unit, the modification in the OrderLines collection will cause a change to Order at the same time.
So if I add a new OrderLine to an Order. I would expect that there will be a LastModifierId and LastModificationTime change on the Order.
I would also expect that
ILocalEventHandler<EntityUpdatedEventData<Order>>
should be triggeredDescribe the solution you'd like
Would it be possible to add a MarkAsModified() method to BasicAggregateRoot? that would mark the entity as modified? So proper audition and event triggers be handled? Or with a repository.UpdateAsync() mark as changed even if there is no property change.
Additional context
The text was updated successfully, but these errors were encountered: