Open Closed

UpdateAsync in Test Method is not updating a sub entity of an AggregateRoot #1697


User avatar
0
agilmore created
  • ABP Framework version: v4.3.2
  • UI type: Blazor
  • DB provider: EF Core

I have the following test method in a test class that derives from AppDomainTestBase

The Column class is managed through the EntityInstance AggregateRoot.

The EntityInstance class has the following AddColumn method:

The AppEfCoreQueryableExtensions class includes:

And the EfCoreEntityInstanceRepository class contains:

So why doesn't ...

return the entity.Columns collection ?

Is it because of Unit of Work ?

By the way I was blocked from submitting this issue with the code embedded as text.


8 Answer(s)
  • User Avatar
    0
    maliming created
    Support Team Fullstack Developer

    HI

    Your code seems no problem. Can you share a project that can reproduce?

  • User Avatar
    0
    agilmore created

    Is there a way to provide my Project privately ?

  • User Avatar
    0
    maliming created
    Support Team Fullstack Developer

    hi

    liming.ma@volosoft.com

  • User Avatar
    0
    agilmore created

    I've sent the project by email.

    By the way, the Test class that contains the Test method is "EntityInstanceManager_Tests" in the Datansa.App.Domain.Tests project under the "Solution" folder.

  • User Avatar
    0
    maliming created
    Support Team Fullstack Developer

    hi

    Can you try to use UOW?

  • User Avatar
    0
    agilmore created

    Hi.

    Yes that worked. So the issue was, in the Test class there was no ambient UOW, as there would be in an ApplicationService class.

    Thanks for your help.

  • User Avatar
    0
    maliming created
    Support Team Fullstack Developer

    You're welcome~

  • User Avatar
    0
    ServiceBot created
    Support Team Automatic process manager

    This question has been automatically marked as stale because it has not had recent activity.

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