After I have manipulated the objects for a given Entity I now would like to emit DML (delete, update, insert statements) for that Entity.
I have looked all the way into the PersistenceServer, but am not finding the elegant hook I am looking for.
PersistenceServer has the AdapterProviderMap which may help if I could add my own IAdapterProvider at the right moment in time, but cannot get to the underlying instance via PersistenceServer. And even that seems like it would be more work than would be practical for one single Entity. Next thought ...
It seems like overriding the TransactionManagerHelper.SaveTable(...) method would head me down the path I am looking for. This would mean creating my own ITransactionManager (that would use my helper imp) which leads to creating my own PersistenceServer to use my ITransactionManager implementation. PersistenceManager has a ctor that takes a PersistenceServer. But, sheesh ...
See my point? I think I am over complicating this.
Is there a simple way to have pm.SaveChanges() emit a SQL DML script and *think* it saved successfully if the script was saved - and save nothing to the table it originally read from?
If need be I can just hard code the DML in the Entity - but thought there must be an elegant solution to allow DevForce to call the delete, update, inserts in the correct order, etc.
Thanks in advance.