So this is sort of a conceptual question, I'm looking for some advice on a creative way to solve this problem.
My Silverlight app uses RIA services on an SQL2008 server backend. One database for all users. We have created a set of sample data and would like some way that we can duplicate that sample data for a new user.
I know that I can hard code a routine to create this data on demand, but I'm looking for a solution that is a little more creative than that so that as we change the original sample data, that changed data is used to create the sample data for new users without having to rework the routine that creates the copies.
The sample data exists in many tables with foreign keys, etc, so it has to be done in a way that child entities become children of the new copy of the parent entities.
Thanks in advance,
There is a library in RIA Services Contrib called EntityGraph that can do an operation across a graph of entities. You may be able to use EntityGraph to clone a graph of entities and rekey them. If you need help ask on the contrib message boards (riaservicescontrib.codeplex.com) and Merijn should be able to help you out.