OData-related field selection syntax

Just wondering what the correct syntax is to add a related field to the select statement. Example. All employees have a department, which is set in the departmentID field in the Employee table. What is the OData selection syntax if I want to drop all employees but only want to show their names FirstName and DepartmentName. I thought it would be something like http://example.com/odata.svc/Employees ? $ Select = FirstName, + Department.DepartmentName

+3
source share
1 answer

The syntax for this is: http://mywebsite.com/odata.svc/Employees?$select=FirstName,Department/DepartmentName&$expand=Department

() API OData: http://odata.stackexchange.com/stackoverflow/atom/Users?$select=DisplayName,Badges/Name&$expand=Badges

+3

Source: https://habr.com/ru/post/1775510/


All Articles