Пример #1
0
 public JArray ApplyQuery(JArray queryable, JsonQueryOptions queryOptions)
 {
     return queryOptions.ApplyTo(queryable);
 }
Пример #2
0
 public JObject ApplyQuery(JObject entity, JsonQueryOptions queryOptions)
 {
     return queryOptions.ApplyTo(entity);
 }
Пример #3
0
        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);
            }
        }