WCF Data Services 5.5.0 Prerelease

It’s that time again: yesterday we uploaded an RC for the upcoming 5.5.0 release. The 5.5.0 release will be another NuGet-only release.

What is in the release:

This release has two primary features: 1) significant enhancements to the URI parser and 2) public data source providers.

URI Parser

In the 5.2.0 release ODataLib provided a way to parse $filter and $orderby expressions into a metadata-bound abstract syntax tree (AST). In the 5.5.0 release we have updated the URI parser with support for most OData URIs. The newly introduced support for parsing $select and $expand is particularly notable. With the 5.5.0 release the URI Parser is mostly done. Future releases will focus on higher-order functions to further improve the developer experience.

Note: We are still trying to determine what the right API is for $select and $expand. While the API may change before RTM, the feature is functionally complete.

Public Data Source Providers

In this release we have made the Entity Framework and Reflection data source providers public. This gives more control to service writers. There is more work planned in the future but the work we’ve completed allows some advanced scenarios which were not possible earlier. For example, a service writer can now make use of the Entity Framework query-caching feature by intercepting the request and parameterizing the LINQ query before handing it off to Entity Framework. (Note that parameterizing a LINQ query is not the same as parameterizing a SQL query; EF always does the latter and therefore there is no security implications to failing to parameterize a LINQ to Entities query, the only impact is performance related.)

While the potential unlocked with this release is limited, this is the first move in a direction which will unlock many previously unachievable scenarios with the built in providers.

Comments (14)

  1. Is EF 6.0 beta1 supported with this new public provider concept?

  2. Miguel Hasse says:

    Public Data Source Providers… finally!

  3. houston home services says:

    God post!!! Thanks for the advice, I want to reccomend you this page that bring you more benefics if you want to repair something in your house. With houston home services you life are more easy… Click here!!

  4. This is great news 🙂 Can't wait the news when you'll say you have integrated it with EF 6.0 !!

  5. Thanks you guys, you are doing amazing work here with WCF Data Services, I really appreciate you make  public the built-in providers. I had been making pitfalls loading them through reflection.

    I have been moving towards some scenaries where a different perspective could be nice. For example I’ve been working around to generate a custom WCF Data Service Provider from one Entity Data Model (it is extended with custom annotations to guide layer code generation). I’ve read your source code to follow your logic, but I discovered many logic that I cannot do myself because it requires access to internal members, for example the custom annotations.

    I use the EDM on design mode, that means you must create a EDM, annotate it with custom annotations on EF designer and I generate the source code to cover the application architecture logic, but you really don’t have the EDM on runtime.  It means I cannot use the built-in WCF Data Service EF provider, then I use your Reflection Provider.  Of course I dealt too with missing features like enum support. I don’t understand why, at least, you don't generate enum properties based on numeric enum type (byte, int). Is there any problem with this temporal solution?

    The reflection provider requires one defined type with properties and all steps you know it’s needed. Could the reflection provider do expose members to make fluent and interactive metadata generation? For example: GetResourceType(Type t), GetResourceProperty(PropertyInfo info), it can allow to me use your baseline logic and insert my own information including but not limited to virtual properties and/or associations.

    I guess I cannot emit the virtual types because on these cases the InstanceType will not be the real type.


    PD: If you need I can write more details about my scenary.

  6. John Crim says:

    Being able to use EF 6.0 (prerelease) with the public EF provider would be huge.  If you don't decide to make that possible, could you release the source code for the EF provider?  If this isn't possible, I'll have to migrate everything to Web API OData, since that seems a better long-term approach that implementing my own EF provider from scratch (unfortunately Web API OData is missing features, too).

  7. Where can I find samples and information how to use the newly provided public Framework and Reflection data source providers. I see that I can now inherit from your providers, but how to compose the DataService with the custom implementations?

    Do we need to implement IServiceProvider interface to DataServie<T>?


  8. Kos says:

    are lacking in the grouping. It would be a great option! As well as the normal support FirstOrDefault

  9. How to avoid that some EF Code First Properties are visible / published to the OData Model? I'm trying to hide implementation details for localized data fields ( storing the same column in different languages) into the model without letting the dataservice consumer know..

    I'm looking for a way to replicate the [NotMapped] behavior of the ReflectionProvider but for the newly EntityFrameworkDataServiceProvider class.

    Any help is well appriciated

  10. Hello

    I continue generating a custom WCF Data Service so I discovered the following points (I left you a comment here on Tue, May 21 2013 3:51 PM):

      1.   The <base address><data service>.svc fails when you specify a property with not public getter with something like null “method” value.

      2.   The <base address><data service>.svc works, but <base address><data service>.svc$metadata fails when you specify a property on base ResourceType (ResourceType “A” for example with ResourceProperty named “B”) and inherited by other ResourceType with the same name (ResourceType “B” too, but inheriting from ResourceType “A”). The interesting is a model with similar case was accepted like valid entity data model.

    The attention I would like you pay here is I knew about the first reading decompiled source code and the second because I tested with Mozilla, but with Internet Explorer I never received the information feedback with verbose options enabled in WCF Data Service. Perhaps it happens because I am failing to configure Fiddler, I just install Fiddler and when I opened Mozilla it informed something about Fiddler add-on, is something missing with IE? I was about a week dealing with this two points.

    I am just giving you this details and inviting you let me know (me and the community) how can I take more informative errors when I am writing custom WCF Data Service support or consider it if we don’t have many choices now.


  11. sf.petru says:

    cool stuff, tried it, got the result seen here (last post)


    still trying to figure out how to update and delete and keep the parameterexpression. hope this is part ofthe current potential unlock. now that I have seen the performance gain the uri parser is a big yawn.

  12. Wow, we really missed some comments here, sorry about that!

    @Chris/DotNetWise/John – no EF6 support yet, but we're obviously headed in that direction. We don't have an explicit plan at this point. I also like the idea of releasing this code publicly, but that's not a possibility quite yet. Because of some coupling issues (remember that this code base started almost a decade ago now), there is some refactoring necessary before we can make it really easy for someone else to just modify the existing EF provider to support EF6. It's not as straightforward as just updating the namespaces etc.

    @Jawilliam – per enum support, we didn't want to do something temporary because of the breaking changes that makes down the road. Enums are part of OData v4, which will enable WCF DS to have first class support for them.

    @Chris – yes, you need to implement IServiceProvider to use the public providers. Is there a reason [NotMapped] isn't working for you? It should. If there's a problem there, I'd love to know about it.

    @Cyril – that's exactly the type of scenario we've envisioned for this first round, but as you point out it's pretty technical and so many people won't really understand it. In a future release we hope it will be easier for people to do more straightforward things (like the enum support that we hear asks for all the time :)).

  13. James Dingle says:

    Can I understand that now I can reuse the reflection provider as metadata provider and provide my own query provider?