I am currently starting a new ASP.NET MVC Project at work where we need to generate a project cost estimate.
We are using NHibernate, ASP.NET MVC 1.0 and StructureMap.
The client wants to be able to fill all the information about the project, the information is in different pages and we need to persist in between each post back.
The client does not want to have the option to Save it under a name when it is completed, but we want to persist it in the database even when he did not save it yet. So we had the idea to create a "Draft mode", so the user will start working on his project, will fill all the pages, and it will be persisted in the database with the "Draft mode" on.
But we need to manage the drafts, I mean, when the user will start editing an existing project, we will need to create a copy of it, set the object and all its childs to Draft mode and create a copy of it in our database. We will need to alter all the references from the childs.
So, I am trying to find the best way to deep copy the objects and alter all the references, I would prefer to do not have to create a copying class for every entity that I will have to copy, maybe something more generic if this is possible.
Please let me know if you need more details or if something is unclear.
Thanks,
Charles