Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Entity Framework - Entity Collection Refresh
Message
De
11/05/2010 01:15:45
 
 
À
10/05/2010 22:40:05
Information générale
Forum:
ASP.NET
Catégorie:
ADO.NET
Versions des environnements
Environment:
C# 3.0
OS:
Windows XP SP2
Network:
Windows 2003 Server
Database:
MS SQL Server
Application:
Desktop
Divers
Thread ID:
01464069
Message ID:
01464087
Vues:
61
>I have a back end data store that is receiving frequent updates from another process. (Currently SQL Express 2005 but I don't want to tie myself to that.)
>
>I have one table of groups and another that is children of that group, some of the children are periodically moved from one group to another and sometimes new children are added.
>
>When I do a:
>
>MyContext.Refresh(RefreshMode.StoreWins, group.children);
>
>The child collection does not reflect any of the added children. Is there a way to get these child collections to fully refresh?

OK... I got a little further:

group.children.Load(MergeOption.OverwriteChanges);

Does cause the children to refresh. Unfortunately... when it comes to the AssociationChanged Event:

"Events may be suppressed during bulk operations, such as Load, Attach, and Clear."

So I'm still searching for a way to update anything else that might need updating and I'm unsure how it will behave in WPF. (I'll have to test that.)
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform