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

Thread is closed for posting
3 posts, 0 answers
  1. Pavel
    Pavel avatar
    5 posts
    Member since:
    Oct 2013

    Posted 19 Feb 2016 Link to this post

    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


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

  2. RIT
    RIT avatar
    21 posts
    Member since:
    Apr 2015

    Posted 01 Mar 2016 in reply to Pavel Link to this post


    Then add IsManaged to your parent.children association configuration.

  3. Pavel
    Pavel avatar
    5 posts
    Member since:
    Oct 2013

    Posted 01 Mar 2016 Link to this post

    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.

Back to Top