FetchEntityCollection After UnitOfWork.Commit failes

Posts   
 
    
LordBauer
User
Posts: 9
Joined: 14-Apr-2008
# Posted on: 05-Mar-2009 09:53:51   

Hello,

Three Tables:

A ==> Object aEntity B C

Over Table B there is a n:m Relation between A and C

I delete rows in B over UnitOfWork object. (UnitOfWork.AddForDelete(B,true).

After deleteion the collection (A.C_CollectionViaB) is not up to date. So I ReFetch the collection (A.C_CollectionViaB). But the collection is always not up to date.

It is first up to date if I Reload Entity A, Why?

Regards

Walaa avatar
Walaa
Support Team
Posts: 14993
Joined: 21-Aug-2005
# Posted on: 05-Mar-2009 09:58:02   

Because it'sReadOnly Before refetching you need to set the collection's ReadOnly property to false, and call it's Clear() method.

This has been discussed here: http://www.llblgen.com/TinyForum/Messages.aspx?ThreadID=15415

LordBauer
User
Posts: 9
Joined: 14-Apr-2008
# Posted on: 05-Mar-2009 12:00:38   

Hello again,

thx. This is actuell my way too, to fix this situation.

I have thought that way is not the best, so I ask here.

you can close this thread.

Regards