DeleteMulti()

Posts   
 
    
Posts: 3
Joined: 07-Jul-2005
# Posted on: 07-Jul-2005 18:04:13   

Hi, I am using LLBLGen Pro. Version 1.0.2004.2 (June 13, 2005) with generator configuration Self Servicing, general scenario Vs .NET 2003. I am posting this question because I can’t find the response in the LLBL Gen Pro help. The question is, when the method DeleteMulti with no parameters is called over the collection objects, when does occur effectively the deletion of the rows? I suppose that the entities are marked to delete and deleted when saved, is this right? If it’s right why do the entities remain visible in the collection?

I am doing code as follows. The corresponding rows in table WT_tErrosAccoes are erased only when executed the method Save(true) ?

… … … accao.WT_tAvisosAccoes.DeleteMulti(); if(accao.WT_tErrosAccoes.Count>0) { accao.WT_tErrosAccoes.Clear(); } … … … … accao.Save(true);

Thanks.

Posts: 3
Joined: 07-Jul-2005
# Posted on: 08-Jul-2005 15:38:28   

DeleteMulti() method doesn’t work as I expected but unit of work solves my problem.

Thanks.

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39933
Joined: 17-Aug-2003
# Posted on: 08-Jul-2005 20:46:00   

NunoMonteiro wrote:

Hi, I am using LLBLGen Pro. Version 1.0.2004.2 (June 13, 2005) with generator configuration Self Servicing, general scenario Vs .NET 2003. I am posting this question because I can’t find the response in the LLBL Gen Pro help. The question is, when the method DeleteMulti with no parameters is called over the collection objects, when does occur effectively the deletion of the rows? I suppose that the entities are marked to delete and deleted when saved, is this right? If it’s right why do the entities remain visible in the collection?

No, they're deleted one by one in a transaction when you call DeleteMulti(). Save only saves changes, like new entities or changed entities, deletes have to be made explicitly.

If you want to postpone this, you indeed should use a UnitOfWork simple_smile

Frans Bouma | Lead developer LLBLGen Pro