public JArray ApplyQuery(JArray queryable, JsonQueryOptions queryOptions) { return queryOptions.ApplyTo(queryable); }
public JObject ApplyQuery(JObject entity, JsonQueryOptions queryOptions) { return queryOptions.ApplyTo(entity); }
private object ExecuteQuery(object response, HttpRequestMessage request, HttpActionDescriptor actionDescriptor) { JsonQueryOptions queryOptions = new JsonQueryOptions(request); ValidateQuery(request); // apply the query JArray enumerable = response as JArray; if (enumerable == null) { // response is not a collection; we only support $select on single entities. JObject single = response as JObject; return ApplyQuery( single,queryOptions); } else { // response is a collection. return ApplyQuery(enumerable, queryOptions); } }