Hi, Now studying disconnected state, found a strange behavior (which I'm trying to believe is my mistake but I can't find it. Here's the piece of code:
In this snippet, "Collection" is an EntitySet<item>. The method with this code is being tested by standard MSTest tests. The above snippet will work (i.e. it will correctly find the items in Collection matching the criteria) if I'm working in standard mode with DO4. When I'm working in Disconnected State, even inside a .Connect() using block, it won't work the same despite the fact that "Collection", "anEntity1" and "anEntity2" have the exact same state than when in "Connected Mode". The really weird behavior is that a simple change in the snippet above seem to fix everything in disconnected mode:
The simple fact that I generate a list from the EntitySet before applying the .Where extension, seem to fix the issue. Am I missing something really obvious here? Or is this truly strange? Thanks! |
Hello Pedro, unfortunately DisconnectedState has poor design and unclear semantics. Its usage is not recommended. For simple scenarios (e.g. WinForms/WPF applications) you can use sessions in ClientProfile mode. This mode rectifies DisconnectedState problems. We are going to improve it and remove DS from implementation in future while keeping the same API and semantics. For truly disconnected operations we are developing Microsoft Sync Framework extension which is expected to be available within a month. |