csla icon indicating copy to clipboard operation
csla copied to clipboard

n-level undo should be serializer-neutral

Open rockfordlhotka opened this issue 8 months ago • 1 comments

Right now, the n-level undo code in UndoableBase has some direct dependencies on MobileFormatter.

That should be changed to rely on the configured serializer.

rockfordlhotka avatar Mar 06 '25 19:03 rockfordlhotka

FWIW this issue is how I found it. Basically, during BeginEdit(), the configured formatter is given a BusinessRules instance, but since my formatter doesn't see it implement the custom interface I think it should, it failed.

I added code to fall back to MobileFormatter in this case, but this really shouldn't be needed. I wonder if this issue would be the key to rectifying this, at least partially.

JasonBock avatar Mar 06 '25 21:03 JasonBock

@JasonBock I think we can totally have UndoableBase call the configured serializer. But I don't know if that'll help you because we are probably serializing types internal to CSLA, so they can't be decorated with attributes or interfaces from external libraries like your serializer.

Would it really work for UndoableBase to invoke your serializer on a type that you wouldn't recognize as a serializable type?

rockfordlhotka avatar Oct 23 '25 19:10 rockfordlhotka