Open ramifi opened 7 years ago
@ramifi: this is by design. The function is running in the context of the previous navigation part (Offers entity set in this case). You can implement such custom logic in the Offers controller class which will affect the result of the function. You can use the @odata.result parameter decorator to get access to that result set. These navigation parts are working like middlewares.
Thanx lazarv. How can I call to the function without the generic get method?
@ramifi: you should implement a function import in the server class and call that like /getCheapestProduct(campaign_id='5967c67258a92021c8d350e8')
.
How do I do that? Do you have an example?
See the according part in this blogpost. It's the same as implementing an entity or entity collection bound function, but use the @Edm.FunctionImport decorator. initDb
in the examples are action import implementations. Function imports are the same with a return type defined.
Hi When I am calling a function like: http://laptop:3000/Offers/xact.getCheapest(campaign_id='5967c67258a92021c8d350e8')
The function getCheapest is called BUT the generic get method called also.