Jul 8, 2014 at 11:25 AM
Edited Jul 15, 2014 at 5:43 AM
The reason for this question is because I am building a Windows App. This App will have to compose a webservice request with data which comes from the following locations:
- other domain objects (in memory)
- local storage (stored as JSON)
- device settings (stored as JSON)
- roaming settings (stored as JSON)
What I would like to do is build a single domain model
- partial fill it with data from all above mentioned locations (deserialize JSON to domain object, copy from in memory objects)
- allow the user to modify the settings in the GUI
- add process output
- send a subset of the domain model to the webservice (this subset is a collection of several properties from all sets)
- save another subset of the domain model back to the roaming settings
- save yet another subset of the domain model back to the device settings
- save yet another subset of the domain model to local storage
I already saw it is possible to fill an existing model, so the partial filling should work.
The part I am unsure about is if and how I can specify which property will be serialized in which scenario. I would like to be able to make use of attributes saying a Property will be serialized to DeviceSettings or RoamingSettings or to the webservice or to
all for that matter.
Can this be done with the current state of the code?