I cannot seem to get the RefetchEntities to work for us. I have a PersistanceManager loaded with items. I process some data in a WCF Service that adds records related to my main entity.
Session.PM.RefetchEntities(app.CommTransactions, MergeStrategy.OverwriteChanges);
foreach (CommTransaction ct in app.CommTransactions.ToList())
{
Session.PM.RefetchEntities(ct.CompanyCBResults, MergeStrategy.OverwriteChanges);
Session.PM.RefetchEntities(ct.PrincipalCBResults, MergeStrategy.OverwriteChanges);
Session.PM.RefetchEntities(ct.SubmissionErrors, MergeStrategy.OverwriteChanges);
ct.PrincipalCBResults.ToList().ForEach(p => Session.PM.RefetchEntities(p.PrincipalCBTradeLines, MergeStrategy.OverwriteChanges));
}
The code above does not fetch any new records that were added to the SubmissionErrors collection. I can't understand why.
If anyone has any ideas please let me know. We are supposed to release to production in less than 2 weeks. I am in a real bind here if I can't get this to work.