[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]
Subject: RE: Function Import questions
Thanks for the responses. Sorry it took a while for me to follow up. I have been reading through the 4.0 and 4.0.1 specs some more.
In the Protocol document for both 4.0 and 4.1, it states that a Function Import MUST NOT be used inside the $filter or $orderby system query options. Did something change such that Function Imports can be used in a $filter _expression_ and the text in the spec is wrong or are Function Imports indeed not allowed in the $filter clause?
Going back to my first question, the function definition for GetPersonWithMostFriends in the TripPin services does not include the IsComposable element which means that function is not composable. Since the function is not composable, additional path segments are not allowed after the function. Is that correct?
Maybe this is something we could discuss some in the call this week?
Question 1: yes, that should be possible:
resourcePath = …
/ entityFunctionImportCall [ singleNavigation ]
singleNavigation = …
[ "/" propertyPath
Question 2: yes, if you prefix the unqualified function import with $root/
http://services.odata.org/TripPinRESTierService/(S(2yexst3navg3ksybtvafe0ux))/People?$filter=LastName eq $root/GetPersonWithMostFriends()/LastName
Which is not implemented by the TripPin service.
I am trying to come up with an example of using a function import in a $filter _expression_. I am not having much luck using the TripPin Service.
I can execute the function import query
and it returns the Person Russel Whyte
Then I try to execute the same function import and navigate to the LastName property of the Person returned
This returns a 500 response with the message “The page cannot be displayed because an internal server error has occurred.”
Question 1: Should I be able to navigate to a property of an Entity returned by the function import?
Finally I try using the function import in a $filter _expression_
http://services.odata.org/TripPinRESTierService/(S(2yexst3navg3ksybtvafe0ux))/People?$filter=LastName eq Microsoft.OData.Service.Sample.TrippinInMemory.Models.GetPersonWithMostFriends()/LastName
This also returns a 500 response with the message “An error has occurred”. I suspect this query may be failing for the same reason as the previous query. I realize this is a contrived query since I can get the desired result by calling the function import directly.
Question 2: Should I be able to use a function import in the $filter _expression_ as in the above query?