I have a scenario with CSLA v1 and v2 that requires some reflection by the community.
I have a business collection class where I am not using BeginEdit so my edit level is always 0. I am adding and removing many new objects from the collection during my use case. So many objects that when I serialize my state to disk it very quickly grows larger than 2MB. This is greatly impacting the performance of the application unnecessarily.
What would be the purpose of adding new edit level zero objects to the deleted list in the DeleteChild method?
Does this seem like a solid optimization to add the following if statement to the DeleteChild method in BusinessCollectionBase?
private void DeleteChild(C child)
{
// mark the object as deleted
child.DeleteChild();
if (_editLevel > 0 && !child.IsNew)
DeletedList.Add(child);
}
What would be the risk? Am I missing any scenarios? I reviewed CSLA 1.0 Pages 236-246 but everything centers around BeginEdit scenarios.
I tend to shy away from changes to CSLA but this one might be necessary unless I am just missing something.
Any feedback would be greatly appreciated.
D. Mark Lindell
Thanks for the response. My logic was wrong in my suggested "if" statement.
It should be:
if (_editLevel > 0 || !child.IsNew)
Copyright (c) Marimer LLC