Sunday, March 25, 2018

ODATA Limitations - Actions, Functions



http://www.odata.org/blog/actions-in-odata/

Today in OData the only way to achieve something similar would be to model Actions as Entities, but that is a low fidelity experience with additional baggage. “Actions” will provide a way to inject behaviors into an otherwise data centric model without confusing the data aspects of the model, while still staying true to the resource oriented underpinnings of OData.


UnBound Functions

The function below returns the nearest airport with the input geography point.
GET serviceRoot/GetNearestAirport(lat = 33, lon = -118)

Bound Functions.
The request below returns the favorite airline of a person, in TripPin service, "favorite airline" means airline which user choose most times. The function GetFavoriteAirline() is bound to Person.
GET serviceRoot/People('russellwhyte')/Microsoft.OData.SampleService.Models.TripPin.GetFavoriteAirline()

SAP ODATA has no support for this. You can only create Bound Functions

https://help.sap.com/viewer/68bf513362174d54b58cddec28794093/7.4.19/en-US/c5dc22512c312314e10000000a44176d.html

No comments:

Post a Comment