Silverlight Client Library
LINQ Querying
At first it looks like the linq syntax can't be used from your context, because all queries are asynchronous and IEnumerable obviously doesn't have a BeginExecute method. To use the Linq syntax you need to cast your eventual query:
var query = (DataServiceQuery<Product>)myContext.Products.Where(p => p.SupplierID == 5);
query.BeginExecute(this.HandleQueryResults, query);
Note the query is passed in, this is because you'll need to use the same DataServiceQuery instance to call EndExecute, you can't just use the context.
Change Tracking
The client library doesn't track field changes automatically in the generated types. For this to work you must implement INotifyPropertyChanged in your partial types.
Example:
public partial class Product : INotifyPropertyChanged {
public event PropertyChangedEventHandler PropertyChanged;
partial void OnProductIDChanged() { FirePropertyChanged("ProductID"); }
partial void OnProductNameChanged() { FirePropertyChanged("ProductName"); }
private void FirePropertyChanged(string property) { ... }
}
In version 1.5 the Data Services tooling can generate this for you, but it's currently only in CTP: Introduction to Data Binding in Silverlight 3 with 1.5 CTP2
Updated Server Data
By default the Silverlight client context has MergeOption set to AppendOnly. What this means is that you won't see any changes to entities once you've queried them for the first time, it's a form of caching and performance optimization. To see updates you need to change the MergeOption to OverwriteChanges, this will ensure the objects are updated. You can also throw away your context and re-create.
myContext.MergeOption = MergeOption.OverwriteChanges
Cross Domain Access
The Silverlight generated types for ADO.NET Data Services 1 use their own network stack to make more request verbs available, but unfortunately this means that the cross-domain policies are not applied and you can't make cross-domain requests. To work around this you can either proxy the requests or wait for version 1.5 (CTP 2 currently available) which supports cross-domain in Silverlight 3.
Links: