|
Hi,
DevForce's LINQ-to-Entities does support bindable query results indeed.
You can have bidirectional bindable query results by using ObservableCollection.
While the reladedEntityList is not intended to be used to wrap a query (it's intended to be used as the return value of a collection navigation property), you can do that with ObservableCollection as well.
A suggestion would be creating a "ToObservableCollection" extension method, so you could use like this:
##################
var bindableList = _em1.Customers .Where(c => c.CompanyName.StartsWith("C")) .ToObservableCollection();
##################
The extension method would look like this (please note that the code below does not do any error checking):
##################
public static ObservableCollection<T> ToObservableCollection<T>(this IEnumerable<T> items) { var result = new ObservableCollection<T>(); foreach (var each in items) { result.Add(each); } return result; }
##################
You might also be interested in knowing about the EntityListManager, so you could monitor the entire cache to any changes that could affect bindableList (but made directly into it). You can find more information about the EntityListManager in the http://drc.ideablade.com/xwiki/bin/view/Documentation/TheEntityListManager - DevForce Resource Center .
|