コード例 #1
0
 private FeedResponse <T> CreateChangeFeedResponseHelper <T>(
     ResponseMessage cosmosResponseMessage)
 {
     return(ReadFeedResponse <T> .CreateResponse <T>(
                cosmosResponseMessage,
                this.serializerCore));
 }
コード例 #2
0
 private FeedResponse <T> CreateChangeFeedResponseHelper <T>(
     ResponseMessage cosmosResponseMessage,
     Documents.ResourceType resourceType)
 {
     return(ReadFeedResponse <T> .CreateResponse <T>(
                cosmosResponseMessage,
                this.serializerCore,
                resourceType));
 }
コード例 #3
0
 private FeedResponse <T> CreateChangeFeedResponseHelper <T>(
     ResponseMessage cosmosResponseMessage)
 {
     using (cosmosResponseMessage.Trace.StartChild("ChangeFeed Response Serialization"))
     {
         return(ReadFeedResponse <T> .CreateResponse <T>(
                    cosmosResponseMessage,
                    this.serializerCore));
     }
 }
コード例 #4
0
        private FeedResponse <T> CreateQueryFeedResponseHelper <T>(
            ResponseMessage cosmosResponseMessage)
        {
            if (cosmosResponseMessage is QueryResponse queryResponse)
            {
                return(QueryResponse <T> .CreateResponse <T>(
                           cosmosQueryResponse : queryResponse,
                           serializerCore : this.serializerCore));
            }

            return(ReadFeedResponse <T> .CreateResponse <T>(
                       cosmosResponseMessage,
                       this.serializerCore));
        }
コード例 #5
0
        private FeedResponse <T> CreateQueryFeedResponseHelper <T>(
            ResponseMessage cosmosResponseMessage,
            Documents.ResourceType resourceType)
        {
            QueryResponse queryResponse = cosmosResponseMessage as QueryResponse;

            if (queryResponse != null)
            {
                return(QueryResponse <T> .CreateResponse <T>(
                           cosmosQueryResponse : queryResponse,
                           serializerCore : this.serializerCore));
            }

            return(ReadFeedResponse <T> .CreateResponse <T>(
                       cosmosResponseMessage,
                       this.serializerCore,
                       resourceType));
        }
コード例 #6
0
        internal FeedResponse <T> CreateQueryFeedResponse <T>(
            ResponseMessage cosmosResponseMessage)
        {
            //Throw the exception
            cosmosResponseMessage.EnsureSuccessStatusCode();

            QueryResponse queryResponse = cosmosResponseMessage as QueryResponse;

            if (queryResponse != null)
            {
                return(QueryResponse <T> .CreateResponse <T>(
                           responseMessage : queryResponse,
                           jsonSerializer : this.cosmosSerializer));
            }

            return(ReadFeedResponse <T> .CreateResponse <T>(
                       cosmosResponseMessage,
                       this.cosmosSerializer));
        }
コード例 #7
0
        private FeedResponse <T> CreateQueryFeedResponseHelper <T>(
            ResponseMessage cosmosResponseMessage)
        {
            if (cosmosResponseMessage is QueryResponse queryResponse)
            {
                using (cosmosResponseMessage.Trace.StartChild("Query Response Serialization"))
                {
                    return(QueryResponse <T> .CreateResponse <T>(
                               cosmosQueryResponse : queryResponse,
                               serializerCore : this.serializerCore));
                }
            }

            using (cosmosResponseMessage.Trace.StartChild("Feed Response Serialization"))
            {
                return(ReadFeedResponse <T> .CreateResponse <T>(
                           cosmosResponseMessage,
                           this.serializerCore));
            }
        }
コード例 #8
0
        private FeedResponse <T> CreateQueryFeedResponseHelper <T>(
            ResponseMessage cosmosResponseMessage,
            Documents.ResourceType resourceType)
        {
            //Throw the exception
            cosmosResponseMessage.EnsureSuccessStatusCode();

            QueryResponse queryResponse = cosmosResponseMessage as QueryResponse;

            if (queryResponse != null)
            {
                return(QueryResponse <T> .CreateResponse <T>(
                           cosmosQueryResponse : queryResponse,
                           serializerCore : this.serializerCore));
            }

            return(ReadFeedResponse <T> .CreateResponse <T>(
                       cosmosResponseMessage,
                       this.serializerCore,
                       resourceType));
        }
コード例 #9
0
        private FeedResponse <T> CreateQueryFeedResponseHelper <T>(
            ResponseMessage cosmosResponseMessage,
            bool usePropertySerializer)
        {
            //Throw the exception
            cosmosResponseMessage.EnsureSuccessStatusCode();

            // The property serializer should be used for internal
            // query operations like throughput since user serializer can break the logic
            CosmosSerializer serializer = usePropertySerializer ? this.propertiesSerializer : this.cosmosSerializer;

            QueryResponse queryResponse = cosmosResponseMessage as QueryResponse;

            if (queryResponse != null)
            {
                return(QueryResponse <T> .CreateResponse <T>(
                           cosmosQueryResponse : queryResponse,
                           jsonSerializer : serializer));
            }

            return(ReadFeedResponse <T> .CreateResponse <T>(
                       cosmosResponseMessage,
                       serializer));
        }