Seems the Reactive Extensions team at Microsoft removed the IEvent interface from the library and so now the following code that worked until recently does not compile:
using ODataServiceReference;
public static IObservable<IEvent<LoadCompletedEventArgs>> GetInvoices(Uri uri)
{
var context = new ODataEntities(uri);
var invoices = new DataServiceCollection<ODataEntities.Invoice>(context);
var observable = Observable.FromEvent<LoadCompletedEventArgs>(
i => invoices.LoadCompleted += i,
i => invoices.LoadCompleted -= i);
var query = from i in context.Invoices
select i;
invoices.LoadAsync(query);
return observable;
}
I am trying to discover the best way to get the result of a query from a WCF Data Services DataServiceCollection object. Any thoughts?
Just change
Observable.FromEventtoObservable.FromEventPatternand you should be compiling again.You may want to consider selecting just the good bits however: