question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Two levels of composition doesn't work

See original GitHub issue

Describe the bug Two levels of composition doesn’t work with EF Core

To Reproduce Invoice -> Invoice Line Item -> Invoice Item details

class Invoice
{
    [Composition] 
    List<InvoiceLineItem> InvoiceLineItems { get; set; }
}

class InvoiceLineItem
{
    [Composition]

    List<InvoiceItemDetails> InvoiceItemDetails { get; set; }
}

class InvoiceItemDetails
{
   
}

Expected behavior MapAsync to track down to second level, it only tracks first with EF Core and all InvoiceItemDetails are tracked as Added.

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:10 (8 by maintainers)

github_iconTop GitHub Comments

1reaction
traiannemescommented, Feb 11, 2022

It works like a charm! Thank you Leonardo, really great job! I love it!

1reaction
traiannemescommented, Jan 13, 2022

Your unit test is tracking the entities and that’s why it’s working. At line 50 in the unit test please add “db.ChangeTracker.Clear();” (before mapping the 2nd time) And please add at line 69: await db.SaveChangesAsync(); (you forgot to save the 2nd time)

And then the test will fail with a constraint db error

Now it will work if we eagerly go ahead before await db.MapAsync<>() call and load all the entities from the DB that are in the graph.

If we don’t do that than the composition works a single level down.

Read more comments on GitHub >

github_iconTop Results From Across the Web

What is the term given to two functions when their order ...
Composition is a binary operation on functions that is not necessarily commutative. However, if f∘g=g∘f ...
Read more >
How to properly generate a multi-level composition?
Overriding nested config groups is done with / as separator as documented in the config group description here. Try:
Read more >
After Effects Composition basics | Adobe
Use this document to learn the Composition basics in After Effects. Create one or multiple compositions, learn more about time panel.
Read more >
20 Quick Fixes to Common After Effects Problems - YouTube
01:14 - 2. ... Why can't I see my shapes in the composition window? 03:19 - 6. ... Why are my effects not...
Read more >
How to correctly open a World Composition/Persistent ...
I have tried 2 scenarios: A sub-level with the backdrop setup, doesn't really work because I don't want to spawn a player and...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found