This is a migrated thread and some comments may be shown as answers.

Deleted child etries still exists in navigation property of cached parent record

2 Answers 39 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Pavel
Top achievements
Rank 1
Pavel asked on 19 Feb 2016, 09:56 AM

So i want to know, may be i uncorrectly configured my model, but when i delete child record, it still cached in parent navigation property and application stuck in error like "No record for row..."

My navigation properties is not marked as dependent or managed, i delete child record as follows

db.Delete(child);

and then getting error when accessing parent.childs collection, that still contains that deleted child.

2 Answers, 1 is accepted

Sort by
0
RIT
Top achievements
Rank 1
answered on 01 Mar 2016, 04:11 PM

Read http://docs.telerik.com/data-access/developers-guide/crud-operations/manage-navigation-properties/developer-guide-manage-navigation-properties-one-to-many.

Then add IsManaged to your parent.children association configuration.

0
Pavel
Top achievements
Rank 1
answered on 01 Mar 2016, 04:31 PM

I know about this, we dont use navigation properties to manage relationships.

In addition, this article does not say that this method changes the behavior of the navigation properties when you delete items. Those. it does not say that if I use IsManaged, navigation property will be correctly updated by removing cached item from them.

Tags
General Discussions
Asked by
Pavel
Top achievements
Rank 1
Answers by
RIT
Top achievements
Rank 1
Pavel
Top achievements
Rank 1
Share this question
or