Is your feature request related to a problem? Please describe.
Right now, a serialization author needs to know inaccessible information about a BO to read/write it correctly via a serialization.
Describe the solution you'd like
I'm currently working on a source generator-based serializer for CSLA (https://github.com/JasonBock/CslaGeneratorSerialization). Recently, I updated to a preview version of CSLA (9.0.0-R24070301), and....something changed internally on a BO (BusinessBase<> I believe) such that it completely broke my Reflection-based code. I'd rather not write that code, but it's essential to properly handle serialization of BO types correctly. Really, what should happen is that a BO should know how to read/write its' own metastate, and a serialization author could then ask a BO to read/write its' state without having to worry about private field names and whatnot.
Therefore, I propose that CSLA adds an interface (I'll call it IMobileObjectMetastateFormatter for now, but the final name I'll leave up to Rocky) that has methods that a BO would implement:
Then, as a serialization author, I could invoke these methods at the appropriate times so the values for "is new", "is dirty", etc. are saved and retrieved correctly, and I no longer care how that's done.
Describe alternatives you've considered
Leave things the way they are, and hope that future CSLA changes don't change how internal metastate is managed. (Or, if such a mechanism already exists in CSLA, please tell me :) ).
Is your feature request related to a problem? Please describe. Right now, a serialization author needs to know inaccessible information about a BO to read/write it correctly via a serialization.
Describe the solution you'd like I'm currently working on a source generator-based serializer for CSLA (https://github.com/JasonBock/CslaGeneratorSerialization). Recently, I updated to a preview version of CSLA (9.0.0-R24070301), and....something changed internally on a BO (
BusinessBase<>
I believe) such that it completely broke my Reflection-based code. I'd rather not write that code, but it's essential to properly handle serialization of BO types correctly. Really, what should happen is that a BO should know how to read/write its' own metastate, and a serialization author could then ask a BO to read/write its' state without having to worry about private field names and whatnot.Therefore, I propose that CSLA adds an interface (I'll call it
IMobileObjectMetastateFormatter
for now, but the final name I'll leave up to Rocky) that has methods that a BO would implement:Then, as a serialization author, I could invoke these methods at the appropriate times so the values for "is new", "is dirty", etc. are saved and retrieved correctly, and I no longer care how that's done.
Describe alternatives you've considered Leave things the way they are, and hope that future CSLA changes don't change how internal metastate is managed. (Or, if such a mechanism already exists in CSLA, please tell me :) ).