I have an Invoice
entity with one LineItem
in its line item colletion and then add another LineItem
to it. I now want to discard this addition and refresh the Invoice
from the database and therefore use dbContext.Entry(invoice).Reload()
.
However, the invoice still has two line items after this call, where the second one seems to be a copy of the first one. What is the reason for this and how can I solve it?