Sunday, March 25, 2018

ODATA Limitations - Actions, Functions

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

No comments:

Post a Comment