Add filter on property for odata query
问题 I have an entity: ItContract and every ItContract belongs to an organisation unit. A user logs-in to an organisation unit and have read access to all data. How can I set a filter on organisationUnitId on the server for every odata query? I am using odata v4 with asp.net. 回答1: There is a way to override the queryOption you get in server side. public IHttpActionResult Get(ODataQueryOptions<People> queryOptions) { // get the original request before the alterations HttpRequestMessage