internal CosmosUserDefinedFunctionResponse CreateUserDefinedFunctionResponse(
     CosmosResponseMessage cosmosResponseMessage,
     CosmosUserDefinedFunction userDefinedFunction)
 {
     return(CosmosUserDefinedFunctionResponse.CreateResponse(
                cosmosResponseMessage,
                this.jsonSerializer,
                userDefinedFunction));
 }
예제 #2
0
 /// <summary>
 /// Create the cosmos user defined function response.
 /// Creates the response object, deserializes the
 /// HTTP content stream, and disposes of the HttpResponseMessage
 /// </summary>
 /// <param name="cosmosResponseMessage"><see cref="CosmosResponseMessage"/> from the Cosmos DB service</param>
 /// <param name="jsonSerializer">The cosmos json serializer</param>
 /// <param name="userDefinedFunction">The cosmos user defined function</param>
 internal static CosmosUserDefinedFunctionResponse CreateResponse(
     CosmosResponseMessage cosmosResponseMessage,
     CosmosJsonSerializer jsonSerializer,
     CosmosUserDefinedFunction userDefinedFunction)
 {
     return(CosmosResponse <CosmosUserDefinedFunctionSettings>
            .InitResponse <CosmosUserDefinedFunctionResponse, CosmosUserDefinedFunctionSettings>(
                (httpResponse) => new CosmosUserDefinedFunctionResponse(cosmosResponseMessage, userDefinedFunction),
                jsonSerializer,
                cosmosResponseMessage));
 }
 /// <summary>
 /// A private constructor to ensure the factory is used to create the object.
 /// This will prevent memory leaks when handling the HttpResponseMessage
 /// </summary>
 internal CosmosUserDefinedFunctionResponse(
     HttpStatusCode httpStatusCode,
     CosmosResponseMessageHeaders headers,
     CosmosUserDefinedFunctionSettings cosmosUserDefinedFunctionSettings,
     CosmosUserDefinedFunction userDefinedFunction) : base(
         httpStatusCode,
         headers,
         cosmosUserDefinedFunctionSettings)
 {
     this.UserDefinedFunction = userDefinedFunction;
 }
 internal Task <CosmosUserDefinedFunctionResponse> CreateUserDefinedFunctionResponse(
     CosmosUserDefinedFunction userDefinedFunction,
     Task <CosmosResponseMessage> cosmosResponseMessageTask)
 {
     return(this.MessageHelper(cosmosResponseMessageTask, (cosmosResponseMessage) =>
     {
         CosmosUserDefinedFunctionSettings settings = this.ToObjectInternal <CosmosUserDefinedFunctionSettings>(cosmosResponseMessage);
         return new CosmosUserDefinedFunctionResponse(
             cosmosResponseMessage.StatusCode,
             cosmosResponseMessage.Headers,
             settings,
             userDefinedFunction);
     }));
 }
예제 #5
0
 /// <summary>
 /// A private constructor to ensure the factory is used to create the object.
 /// This will prevent memory leaks when handling the HttpResponseMessage
 /// </summary>
 private CosmosUserDefinedFunctionResponse(
     CosmosResponseMessage cosmosResponse,
     CosmosUserDefinedFunction userDefinedFunction) : base(cosmosResponse)
 {
     this.UserDefinedFunction = userDefinedFunction;
 }