← Prev in month ← Prev in thread

Function Import questions

From
Mark Biamonte <>
Date
2017-10-12T22:36:11+00:00
ID
Thread
Function Import questions
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

 

http://services.odata.org/TripPinRESTierService/(S(2yexst3navg3ksybtvafe0ux))/GetPersonWithMostFriends()

 

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

http://services.odata.org/TripPinRESTierService/(S(2yexst3navg3ksybtvafe0ux))/GetPersonWithMostFriends()/LastName

 

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?

 

Thanks

Mark
← Prev in month ← Prev in thread