none
Custom operator in wcf data services? RRS feed

  • Question

  • I have build a wcf data services providers to interact with my data source engine. My data source engine has a special operator, SET.

    I want to be able to query -> /?$filter=Property1 eq 'Value1' and Property2 SET 'Value2'.

    Is it possible to tell wcf data services that SET is a valid operator that my provider would like to received so that my provider can deal with it?

    Wednesday, January 23, 2013 11:27 AM

Answers

  • We don't have any support in WCF Data Service Providers for this.

    In the future we could support something like this with Functions support. Think of a scenario like

    http://servicebaseUrl/Northwind.svc/Customers/GetTop10Customers(). The GetTop10Customers is a function segment that returns an opaque list of the best 10 customers. In the future we want WCF Data Services to be able to support this and then also so that you can use custom functions in $filter as well. In that way you can then use a custom function called SET. But as I have said this isn't something we support right now.

    Thanks,

    Chris Robinson - WCF Data Services.


    This posting is provided "AS IS" with no warranties, and confers no rights.

    Thursday, January 24, 2013 3:39 PM
    Moderator
  • Also in the next couple release cycles we will start exposing how WCF DS handles the processing of URIs.  It is likely that you could add custom operators to your service by overridding certains parts of the parsing code. Note that this functionality won't be around for a few months, though, and the APIs are not fully designed yet.

    Also note that when you do something like this, you've somewhat departed from OData - Chris' solution stays within the realm of OData. Unfortunantly we don't have function support of the server yet either ;-)

    -Ian

    Thursday, January 24, 2013 11:37 PM

All replies

  • We don't have any support in WCF Data Service Providers for this.

    In the future we could support something like this with Functions support. Think of a scenario like

    http://servicebaseUrl/Northwind.svc/Customers/GetTop10Customers(). The GetTop10Customers is a function segment that returns an opaque list of the best 10 customers. In the future we want WCF Data Services to be able to support this and then also so that you can use custom functions in $filter as well. In that way you can then use a custom function called SET. But as I have said this isn't something we support right now.

    Thanks,

    Chris Robinson - WCF Data Services.


    This posting is provided "AS IS" with no warranties, and confers no rights.

    Thursday, January 24, 2013 3:39 PM
    Moderator
  • Also in the next couple release cycles we will start exposing how WCF DS handles the processing of URIs.  It is likely that you could add custom operators to your service by overridding certains parts of the parsing code. Note that this functionality won't be around for a few months, though, and the APIs are not fully designed yet.

    Also note that when you do something like this, you've somewhat departed from OData - Chris' solution stays within the realm of OData. Unfortunantly we don't have function support of the server yet either ;-)

    -Ian

    Thursday, January 24, 2013 11:37 PM