School-Student OData service using SqlLite as database.
Here's the School sample data:
Here's Student sample data:
Updated on 2/7/2023: make the basic query on JSON array column:
For example: http://localhost:5168/odata/schools?$filter=Branches/any(a: a/City eq 'Gur')
Basic usages
Run the service and try any of these requests:
Basic query:
http://localhost:5168/odata/$metadata
http://localhost:5168/odata/schools?$filter=schoolid eq 3
http://localhost:5168/odata/schools?$filter=schoolid le 3
http://localhost:5168/odata/schools?$filter=schoolid ge 3
http://localhost:5168/odata/schools?$top=1
http://localhost:5168/odata/schools?$top=1&$skip=2
http://localhost:5168/odata/schools?$top=1&$orderby=schoolId desc
http://localhost:5168/odata/schools?$top=1&$orderby=mailaddress/AptNo
$select:
http://localhost:5168/odata/schools?$top=1&$orderby=mailaddress/AptNo&$select=SchoolName
$expand:
$compute:
http://localhost:5168/odata/students?$select=FirstName,LastName
http://localhost:5168/odata/students?$compute=concat(concat(FirstName,' '),LastName) as FullName&$select=FullName&$count=true
http://localhost:5168/odata/students?$compute=concat(concat(FirstName,' '),LastName) as FullName&$select=FullName&$filter=length(FullName) le 9&$count=true
$apply:
http://localhost:5168/odata/students?$apply=groupby((FavoriteSport))
http://localhost:5168/odata/students?$apply=groupby((FavoriteSport), aggregate($count as count))
http://localhost:5168/odata/students?$apply=groupby((FavoriteSport), aggregate($count as count, Grade with average as Avg, Grade with sum as Total))
$search
http://localhost:5168/odata/students?$filter=grade ge 90 and grade lt 95&$select=Grade
http://localhost:5168/odata/students?$search=A&$select=Grade
http://localhost:5168/odata/students?$search="A%2B"&$select=Grade
More $filter
http://localhost:5168/odata/schools?$filter=ContactEmails/any(a: a eq 'help@mercury.com')
http://localhost:5168/odata/schools?$filter=Branches/any(a: a/City eq 'Gur')