Skip to content

Commit

Permalink
Fixed internal type serialization
Browse files Browse the repository at this point in the history
  • Loading branch information
Jake Willey committed May 14, 2020
1 parent 4d618b6 commit 5adc575
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 5 deletions.
4 changes: 0 additions & 4 deletions Microsoft.Azure.Cosmos/src/Query/v3Query/ReadFeedResponse.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,7 @@
namespace Microsoft.Azure.Cosmos
{
using System.Collections.Generic;
using System.IO;
using System.Net;
using Microsoft.Azure.Cosmos.CosmosElements;
using Microsoft.Azure.Cosmos.Json;
using Microsoft.Azure.Cosmos.Serializer;

internal class ReadFeedResponse<T> : FeedResponse<T>
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ internal static IReadOnlyList<T> FromFeedResponseStream<T>(
using (MemoryStream stream = GetStreamWithoutServiceEnvelope(
streamWithServiceEnvelope))
{
return serializerCore.FromStream<List<T>>(stream);
return serializerCore.FromFeedStream<T>(stream);
}
}
}
Expand Down
7 changes: 7 additions & 0 deletions Microsoft.Azure.Cosmos/src/Serializer/CosmosSerializerCore.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
namespace Microsoft.Azure.Cosmos
{
using System;
using System.Collections.Generic;
using System.IO;
using Microsoft.Azure.Cosmos.Query.Core;
using Microsoft.Azure.Cosmos.Query.Core.QueryPlan;
Expand Down Expand Up @@ -61,6 +62,12 @@ internal T FromStream<T>(Stream stream)
return serializer.FromStream<T>(stream);
}

internal IReadOnlyList<T> FromFeedStream<T>(Stream stream)
{
CosmosSerializer serializer = this.GetSerializer<T>();
return serializer.FromStream<List<T>>(stream);
}

internal Stream ToStream<T>(T input)
{
CosmosSerializer serializer = this.GetSerializer<T>();
Expand Down

0 comments on commit 5adc575

Please sign in to comment.