Although it would be nice if you serialized access to private property, unfortunately, today there is no easy way.
But there is another solution to the architecture. DO NOT destroy business domain requirements; instead, separate your layers similar to the nTeir project and implement the DTO ...
If you separate your activities, then the Datafacade / dataadaptor (factory template works well here) and the DataAccess levels in 3 projects that you can control, referring to the fact that the business never knows about your DTOs. If you decided to remove or implement serialization or exchange it for saving to the SQL server, you would not affect anything in your business level.
There is always one fall, there is even more code to write: * you need to write a converter object for both objects for which you want to go to Dataaccess * you potentially destroy the part of OO that hides sinse. The Save method in business must be converted to the correct type in the Dataface before moving on to dataaccess
You can make it a lot easier with something like nHybinate or similar. cheers choco
source share