Beispiel #1
0
 internal static T[] GetResourcesHelper <T>(
     IReadOnlyList <CosmosElement> cosmosElements,
     CosmosSerializerCore serializerCore,
     CosmosSerializationFormatOptions cosmosSerializationOptions = null)
 {
     using (MemoryStream memoryStream = ElementsToMemoryStream(
                cosmosElements,
                cosmosSerializationOptions))
     {
         return(serializerCore.FromFeedStream <T>(memoryStream));
     }
 }
        internal static IReadOnlyCollection <T> FromFeedResponseStream <T>(
            CosmosSerializerCore serializerCore,
            Stream streamWithServiceEnvelope)
        {
            if (streamWithServiceEnvelope == null)
            {
                return(new List <T>());
            }

            using (streamWithServiceEnvelope)
                using (MemoryStream stream = GetStreamWithoutServiceEnvelope(
                           streamWithServiceEnvelope))
                {
                    return(serializerCore.FromFeedStream <T>(stream));
                }
        }