SaveEntityCollection - dumb question im sure

Posts   
 
    
hplloyd
User
Posts: 191
Joined: 29-Oct-2004
# Posted on: 03-Aug-2005 21:58:35   

I am using the manager classes (modified slightly by me) and have the following code

                ISortExpression sorterActuals = new SortExpression(SortClauseFactory.Create(CubeDealItemUserFieldIndex.CubeDate, SortOperator.Ascending));
                EntityCollection myActuals = CubeDealItemUserManager.MGRGetLoadedActuals(null,sorterActuals);
                
                foreach(CubeDealItemUserEntity myActual in myActuals)
                {
                    myActual.CubeDate.AddMonths(monthsToAdd);
                    myActual.CubeMonth.AddMonths(monthsToAdd);  
                }
                CubeDealItemUserManager.SaveCollection(myActuals);

This code does not update all records in the collection as expected....However if I step through each entity updating individually then that is inefficient with respect to hits to the database.

What am I doing wrong?

What is the quickest and most efficient way to update 1 or more fields in my entity collection?

Many thanks in advance

hplloyd
User
Posts: 191
Joined: 29-Oct-2004
# Posted on: 03-Aug-2005 22:19:46   

OK dont answer that I see the problem!!

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39933
Joined: 17-Aug-2003
# Posted on: 03-Aug-2005 22:39:47   

For future reference, what was the problem, so others might avoid the problem as well? simple_smile

Frans Bouma | Lead developer LLBLGen Pro