示例#1
0
        internal static void CheckEmptySetQueryArguments(IDataService service)
        {
            DataServiceHostWrapper host = service.OperationContext.Host;

            if ((!string.IsNullOrEmpty(host.GetQueryStringItem("$orderby")) || !string.IsNullOrEmpty(host.GetQueryStringItem("$skip"))) || (!string.IsNullOrEmpty(host.GetQueryStringItem("$top")) || !string.IsNullOrEmpty(host.GetQueryStringItem("$inlinecount"))))
            {
                throw DataServiceException.CreateBadRequestError(System.Data.Services.Strings.RequestQueryProcessor_QuerySetOptionsNotApplicable);
            }
        }
示例#2
0
        internal static void CheckEmptyQueryArguments(IDataService service, bool checkForOnlyV2QueryParameters)
        {
            DataServiceHostWrapper host = service.OperationContext.Host;

            if ((!checkForOnlyV2QueryParameters && (((!string.IsNullOrEmpty(host.GetQueryStringItem("$expand")) || !string.IsNullOrEmpty(host.GetQueryStringItem("$filter"))) || (!string.IsNullOrEmpty(host.GetQueryStringItem("$orderby")) || !string.IsNullOrEmpty(host.GetQueryStringItem("$skip")))) || !string.IsNullOrEmpty(host.GetQueryStringItem("$top")))) || ((!string.IsNullOrEmpty(host.GetQueryStringItem("$inlinecount")) || !string.IsNullOrEmpty(host.GetQueryStringItem("$select"))) || !string.IsNullOrEmpty(host.GetQueryStringItem("$skiptoken"))))
            {
                throw DataServiceException.CreateBadRequestError(System.Data.Services.Strings.RequestQueryProcessor_QueryNoOptionsApplicable);
            }
        }