none
Deleted RRS feed

Answers

  • Then first save the graph of children to a new collection variable and then null out the collection in the entity that you are going to Attach and then call the Attach method. Something like this.

    List<ChildrenEntityType> children = ParentEntity.ChildrenCollection;
    ParentEntity.ChildrenCollection = null;
    DbContextInstance.TableName.Attach(ParentEntity);

      


    Fernando (MCSD)

    If a post answers your question, please click "Mark As Answer" on that post and "Mark as Helpful".

    Tuesday, February 26, 2013 4:20 PM

All replies

  • Hi;

    Have you tried nulling the collection that hold the children before calling the Attach method?

      


    Fernando (MCSD)

    If a post answers your question, please click "Mark As Answer" on that post and "Mark as Helpful".

    Tuesday, February 26, 2013 1:44 PM
  • Deleted
    Tuesday, February 26, 2013 4:06 PM
  • Then first save the graph of children to a new collection variable and then null out the collection in the entity that you are going to Attach and then call the Attach method. Something like this.

    List<ChildrenEntityType> children = ParentEntity.ChildrenCollection;
    ParentEntity.ChildrenCollection = null;
    DbContextInstance.TableName.Attach(ParentEntity);

      


    Fernando (MCSD)

    If a post answers your question, please click "Mark As Answer" on that post and "Mark as Helpful".

    Tuesday, February 26, 2013 4:20 PM
  • Deleted
    Wednesday, February 27, 2013 9:24 AM