WCF DataServices & the Processing Pipeline?

I spent quite a lot of time with WCF Data Services (‘Astoria’/’ADO.NET Data Services’ as it was) in its first iteration.

It’s a framework that I really like so I’m feeling a little guilty that I haven’t found time to completely revisit it as it becomes part of a ‘much bigger thing’ (i.e. OData) and as it got rev’d in .NET 4.0 and (from a client perspective) Silverlight 4.

I have been doing some of that revisiting in a piecemeal fashion though and there’s good material out there. For instance I came across articles such as Elisa’s and the main MSDN library page which give you enhancements such as;

  • the DataServiceCollection<T> type on the client side to do a tonne of binding goodness and auto-change tracking
  • server driven paging
  • obtaining a total row count for an entity set either with the data or on its own as a separate piece of data
  • client side projections (i.e. selecting just the columns of data that you want)
  • more flexibility around how you plug in your server side data in order so that you can expose;
    • Entity Framework (EDM) models
    • Reflection based models for LINQ to SQL and any other custom model where you know the “shape” of the model at compile time and can apply attributes to the codebase for the Reflection provider
    • Non-reflection based models including dynamic models via the new interfaces
  • improvements around BLOB support

But I realised that I missed something today when I was casting my eye over this great series of posts;

and I spotted something that I didn’t know about.

I had previously seen that you could hook into the Data Services client side pipeline – that is that the DataServiceContext supports a SendingRequest event that you could use to plug in to ( e.g. the article plugs in and adds an authorization header ).

But what I hadn’t previously seen that you could hook into the Data Services service side pipeline – that the DataService<T> has a property on it called ProcessingPipeline of type ProcessingPipeline with events for [Processing/Processed]Request and [Processing/Processed]Changeset.

I knew that you could write Query and Change interceptors but I had hoped for something more generic and I’d written back in 2008 that I was having trouble because;

“So far, I've not found any place to centralise this code and hook into the dispatch mechanism that Data Services is using”

Well – it looks like that centralised place is there in Data Services in .NET 4.0 and there’s a place to plug in code to the pipeline on the server – very glad to see it Smile

Now…back to that set of articles…

OData Slides from the NxtGen User Group Festival

I did a short session on the Open Data Protocol (OData) last week at the NxtGen User Group and I thought I’d share the slides here.


There are quite a few builds/animations in that slide-deck so I’d suggest that downloading it will produce a better experience than viewing it on SlideShare.

ADO.NET Data Services Session at SQL Bits Manchester

A big thanks to all the people who came along to my session at SQLBits today on ADO.NET Data Services and also to the organisers and community around SQLBits that made the event happen in the first place. I was there for most of the afternoon and it seemed like a fantastic event to me in a cool venue.

As promised, my slides from the session are here for download – you’ll perhaps notice that there are a few additional (hidden) slides in the slide-deck that I didn’t use in this talk as I collapsed this talk down from an earlier talk and updated it to reflect the RTM version of Data Services and also the various CTPs/Previews that are currently kicking around.

So…you get a little more than I actually used at the conference.

Enjoy 🙂