Hi,
I would like to update a lot of records via a uow.AddUpdateMultiCall().
In this situation i need to add an entity with the values to be updated.
So i write:
ActieEntity newValuesVervolg = new ActieEntity();
newValuesVervolg.VervolgActieID = null;
ActieCollection acties = new ActieCollection();
uow.AddUpdateMultiCall(acties, newValuesVorige, ActieFields.VorigeActieID == ID);
The problem is that the InitClassEmpty() of the ActieEntitiy is filled with:
protected override void InitClassEmpty(IValidator validatorToUse)
{
base.InitClassEmpty(validatorToUse);
if (Fields.State == EntityState.New)
{
Datum = DateTime.Today;
Gereed = false;
}
}
We need to add this code in the InitClassEmpty() because the initial values must be refelected in the webpage directly when we create a new record (when we put this in the OnSave() we can't see the initial values).
When i commit the UnitOfWork i see that the following values will be set:
- Datum (because of InitClassEmpty())
- Gereed (because of InitClassEmpty())
- and the field VervolgActieID.
The problem is that the values of "Datum" and "Gereed" may not be updated in the UnitOfWork.
Can you tell me what i'm doing wrong?
Regards,
Sander