MarkForDelete

Posts   
 
    
Jazz
User
Posts: 63
Joined: 12-Aug-2005
# Posted on: 17-Aug-2005 17:59:52   

Hello there,

until now I used to collect all to-be-deleted Entities in a Collection deleted every Entity in there when it comes to save changes.

Is it possible to include a boolean property like MarkForDelete and delete it after calling Save()?

Another thing: Is there a collection for Entity "Features" like ReadOnly PrimaryKey ForeignKey in one collection for automatic processing.

Regards, André

Fishy avatar
Fishy
User
Posts: 392
Joined: 15-Apr-2004
# Posted on: 17-Aug-2005 19:17:10   

Jazz wrote:

Is it possible to include a boolean property like MarkForDelete and delete it after calling Save()?

I would also like this feature. Perhaps have a DeleteMarkedEntities method.

Fishy

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39590
Joined: 17-Aug-2003
# Posted on: 17-Aug-2005 19:31:47   

You could use a UnitOfWork and that will do it for you: save and deletes in the right order. The UnitOfWork is designed especially for this purpose simple_smile

Frans Bouma | Lead developer LLBLGen Pro
Fishy avatar
Fishy
User
Posts: 392
Joined: 15-Apr-2004
# Posted on: 17-Aug-2005 19:48:12   

Otis wrote:

You could use a UnitOfWork and that will do it for you: save and deletes in the right order. The UnitOfWork is designed especially for this purpose simple_smile

Yes, but wouldn't I have to maintain a list of the entities to delete? disappointed

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39590
Joined: 17-Aug-2003
# Posted on: 17-Aug-2005 20:23:25   

Fishy wrote:

Otis wrote:

You could use a UnitOfWork and that will do it for you: save and deletes in the right order. The UnitOfWork is designed especially for this purpose simple_smile

Yes, but wouldn't I have to maintain a list of the entities to delete? disappointed

You can add them one at a time to the unitofwork, they'll be deleted in the order you add them. simple_smile

Frans Bouma | Lead developer LLBLGen Pro
Otis avatar
Otis
LLBLGen Pro Team
Posts: 39590
Joined: 17-Aug-2003
# Posted on: 17-Aug-2005 20:23:53   

Jazz wrote:

Another thing: Is there a collection for Entity "Features" like ReadOnly PrimaryKey ForeignKey in one collection for automatic processing.

I'm not quite sure what you mean by this, do you have an example?

Frans Bouma | Lead developer LLBLGen Pro
Jazz
User
Posts: 63
Joined: 12-Aug-2005
# Posted on: 17-Aug-2005 21:12:44   

Great feature, didn't know about that one.

Thanks.

Fishy avatar
Fishy
User
Posts: 392
Joined: 15-Apr-2004
# Posted on: 17-Aug-2005 22:25:47   

Otis wrote:

Fishy wrote:

Otis wrote:

You could use a UnitOfWork and that will do it for you: save and deletes in the right order. The UnitOfWork is designed especially for this purpose simple_smile

Yes, but wouldn't I have to maintain a list of the entities to delete? disappointed

You can add them one at a time to the unitofwork, they'll be deleted in the order you add them. simple_smile

flushed I just looked at the manual. You make it so easy stuck_out_tongue_winking_eye Thanks smile

Fishy