示例#1
0
 private QueryResponseCore(
     IReadOnlyList <CosmosElement> result,
     bool isSuccess,
     HttpStatusCode statusCode,
     double requestCharge,
     string activityId,
     long responseLengthBytes,
     string disallowContinuationTokenMessage,
     string continuationToken,
     CosmosException cosmosException,
     SubStatusCodes?subStatusCode,
     CosmosQueryExecutionInfo cosmosQueryExecutionInfo = default)
 {
     this.IsSuccess           = isSuccess;
     this.CosmosElements      = result;
     this.StatusCode          = statusCode;
     this.ActivityId          = activityId;
     this.ResponseLengthBytes = responseLengthBytes;
     this.RequestCharge       = requestCharge;
     this.DisallowContinuationTokenMessage = disallowContinuationTokenMessage;
     this.ContinuationToken        = continuationToken;
     this.CosmosException          = cosmosException;
     this.SubStatusCode            = subStatusCode;
     this.CosmosQueryExecutionInfo = cosmosQueryExecutionInfo;
 }
示例#2
0
        internal static QueryResponseCore CreateSuccess(
            IReadOnlyList <CosmosElement> result,
            double requestCharge,
            string activityId,
            long responseLengthBytes,
            string disallowContinuationTokenMessage,
            string continuationToken,
            CosmosQueryExecutionInfo cosmosQueryExecutionInfo = default)
        {
            QueryResponseCore cosmosQueryResponse = new QueryResponseCore(
                result: result,
                isSuccess: true,
                statusCode: HttpStatusCode.OK,
                requestCharge: requestCharge,
                activityId: activityId,
                responseLengthBytes: responseLengthBytes,
                disallowContinuationTokenMessage: disallowContinuationTokenMessage,
                continuationToken: continuationToken,
                cosmosException: null,
                subStatusCode: null,
                cosmosQueryExecutionInfo: cosmosQueryExecutionInfo);

            return(cosmosQueryResponse);
        }